0% found this document useful (1 vote)
448 views

Dotnet Framework Q&A SEM VI 2022-2023

The document discusses various topics related to .NET framework and programming. It explains the purpose of CLR in managing program execution across different languages. It defines CTS as the collection of symptoms associated with median neuropathy at the carpal tunnel. It lists AND and OR as bitwise operators and >> and << as bit shift operators in VB.NET. It explains the functions of MessageBox and InputBox and describes the 'this' keyword in C# and constructors and destructors. It defines server object, menu control types, connected and disconnected architecture in ADO.NET and the timer control in VB.NET. It also discusses HTML controls, ASP.NET basic controls, connection object and data reader in ADO.NET

Uploaded by

anjali das
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
448 views

Dotnet Framework Q&A SEM VI 2022-2023

The document discusses various topics related to .NET framework and programming. It explains the purpose of CLR in managing program execution across different languages. It defines CTS as the collection of symptoms associated with median neuropathy at the carpal tunnel. It lists AND and OR as bitwise operators and >> and << as bit shift operators in VB.NET. It explains the functions of MessageBox and InputBox and describes the 'this' keyword in C# and constructors and destructors. It defines server object, menu control types, connected and disconnected architecture in ADO.NET and the timer control in VB.NET. It also discusses HTML controls, ASP.NET basic controls, connection object and data reader in ADO.NET

Uploaded by

anjali das
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

1

CA-604 : DOT NET FRAMEWORK

a) What is the use of CLR?

The Common Language Runtime (CLR) is programming that manages the execution of


programs written in any of several supported languages, allowing them to share common
object-oriented classes written in any of the languages.

b) What is CTS?

Carpal tunnel syndrome (CTS) is the collection of symptoms and signs associated with median
neuropathy at the carpal tunnel. Most CTS is related to idiopathic compression of the median
nerve as it travels through the wrist at the carpal tunnel (IMNCT).

c) Enlist any two operator in vB.net?

We have seen that the Bitwise operators supported by VB.Net are And, Or, Xor and Not. The Bit
shift operators are >> and << for left shift and right shift, respectively.

d) Explain following Function? i) MessageBox( ) ii) InputBox ( )

The objective of MsgBox is to produce a pop-up message box and prompt the user to click on a
command button before he /she can continues. This format is as follows:

yourMsg=MsgBox(Prompt, Style Value, Title)

An InputBox( ) function will display a message box where the user can enter a value or a
message in the form of text. In VB2005, you can use the following format:

myMessage=InputBox(Prompt, Title, default_text, x-position, y-position)

e) Explain ‘this keyword in C#?

The C# “this” keyword represents the “this” pointer of a class or a stuct. The this pointer
represents the current instance of a class or stuct.
 
The this pointer is a pointer accessible only within the nonstatic methods of a class or struct. It
points to the object for which the method is called. Static members of a class or struct do not
have a this pointer. The this pointer is also used on hidden fields to separate fields with the
method parameters with the same names.

f) Explain constructor and Destructors In C#?

Constructors are a particular type of method associated with a class and gets automatically
invoked when the classes instance (i.e., objects) are created. Like other member functions, i.e.,
methods, these constructors also contain specific instructions that get executed when the
2

objects are created. It is specifically used to assign values to all or some data members of a
class.

Destructor is another method that uses the class-name but is preceded with a ~ (tilde)
operator/symbol. Destructors are used to de-initialize objects, and the memories occupied when
constructors are created. You can consider them as the opposite of constructors.

g) Explain server object?

An object server is the component of an Content Manager OnDemand system that holds the
reports that are accessed by your users. An object server belongs to an Content Manager
OnDemand instance. An instance is a logical server environment consisting of a library server,
one or more object servers, a database, and cache storage.

An Content Manager OnDemand object server has the following characteristics:

 Has its own storage nodes


 Must run in the same code page as the library server
 Uses the security from the library server

h) Explain the type of menu control?

A menu control allows hierarchal organization of elements associated with commands and


event handlers. In a typical Microsoft Windows application, a menu bar contains several menu
buttons (such as File, Edit, and Window), and each menu button displays a menu.

i) Explain connected and Disconnected Architecture in ADO .net?

1. Connected Architecture

 As the name suggests, connected architecture refers to the fact that the connection is established
for the full time between the database and application. For e.g. we make a program in C# that is
connected with the database for the full time, so that will be connected architecture.

2.  Disconnected Architecture

 Disconnected architecture refers to the mode of architecture in Ado.net where the connectivity
between the database and application is not maintained for the full time. Connectivity within this
mode is established only to read the data from the database and finally to update the data within
the database.

j) Explain Timer control in vb.net?

The timer control is a looping control used to repeat any task in a given time interval. It is an
important control used in Client-side and Server-side programming, also in Windows Services.
Furthermore, if we want to execute an application after a specific amount of time, we can use
the Timer Control.
3

a) Explain Architecture of .net fromework?

The architecture of the .Net framework focuses on two main things: The first of these is that the
framework code is largely independent of the language in which it is written. For example, a
framework written in C# can contain calls to libraries written in C++, as well as to libraries
written in other programming languages. This allows .Net programs to be ported to a wide
variety of platforms. The second main goal of the .Net framework is that it should be easy to
adopt. This means that the framework should be designed in a way that makes it easy to
incorporate new features and new functionality into an existing program. The framework should
also be designed in a way that makes it easy to port the program to a different platform or make
the program run on a different type of computer. The .Net framework has been built in a way
that makes it easy for programmers to build new features into their programs. It has also been
built in a way that makes it easy to extend the program with new features.
4

b) What are HTML control?

HTML server controls are HTML elements that contain attributes to accessible at server side. By
default, HTML elements on an ASP.NET Web page are not available to the server. These
components are treated as simple text and pass through to the browser. We can convert an
HTML element to server control by adding a runat="server" and an id attribute to the
component.

c) Explain Asp.net basic control?

ASP.NET provides three types of button control:


 Button : It displays text within a rectangular area.
 Link Button : It displays text that looks like a hyperlink.
 Image Button : It displays an image.
When a user clicks a button, two events are raised: Click and Command.
Basic syntax of button control:
Syntax:

<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Click" / >

d) What is connection object in ADO.net?

A Connection object represents a unique session with a data source. In a client/server database


system, it may be equivalent to an actual network connection to the server. Depending on the
functionality supported by the provider, some collections, methods, or properties of
a Connection object may not be available.

With the collections, methods, and properties of a Connection object, you can do the following:

 Configure the connection before opening it with


the ConnectionString, ConnectionTimeout, and Mode properties. ConnectionString is the
default property of the Connection object.

 Set the CursorLocation property to client to invoke the Microsoft Cursor Service for OLE


DB, which supports batch updates.

 Set the default database for the connection with the DefaultDatabase property.

 Set the level of isolation for the transactions opened on the connection with
the IsolationLevel property.

 Specify an OLE DB provider with the Provider property.


5

 Establish, and later break, the physical connection to the data source with
the Open and Close methods.

 Execute a command on the connection with the Execute method and configure the


execution with the CommandTimeout property.

e) Explain DataReader in ADO.net?

There are two common objects in ADO.NET to read data, DataSet and DataReader. C#
DataSet and C# DataReader classes represent these objects. In this article, we'll learn about
ADO.NET DataReader and how to use a DataReader in C#.
 
A data reader provides an easy way for the programmer to read data from a database as if it
were coming from a stream. The DataReader is the solution for forward streaming data through
ADO.NET. The data reader is also called a firehose cursor or forward read-only cursor because
it moves forward through the data. The data reader not only allows you to move forward through
each record of database, but it also enables you to parse the data from each column. The
DataReader class represents a data reader in ADO.NET.
 
Similar to other ADO.NET objects, each data provider has a data reader class for example;
OleDbDataReader is the data reader class for OleDb data providers. Similarly, SqlDataReader
and ODBC DataReader are data reader classes for SQL and ODBC data providers,
respectively.
 
The IDataReader interface defines the functionally of a data reader and works as the base class
for all data provider-specific data reader classes such as OleDataReader. SqlDataReader, and
OdbcDataReader. Figure 5-36 shows some of the classes that implement IDbDataReader.

a) Write a vb .net program for find max number among Entered two number.

Module Module1
Sub Main()
Dim result As Integer = 0
Dim num1 As Integer = 0
Dim num2 As Integer = 0

Console.Write("Enter Your First number : ")


num1 = Integer.Parse(Console.ReadLine())

Console.Write("Enter Your Second number : ")


num2 = Integer.Parse(Console.ReadLine())

result = If((num1 > num2), num1, num2)

Console.WriteLine("Here Largest Number is: {0}", result)

Console.ReadLine()
6

End Sub
End Module

Output:
Enter Your first number : 10
Enter Your Second number : 30
Here Largest Number is: 30

b) Write a vb .net program to check whether Enter string is palindrome or no.

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles Button1.Click
        Dim s As String
        Dim r As String
        s = TextBox1.Text
        r = StrReverse(s)
        If s = r Then
            MessageBox.Show("Enterd String is Palindrome")
        Else
            MessageBox.Show("Enterd String is Not Palindrome")
        End If
    End Sub
End Class

c) Write a vb .net program to accept a number from user through input box and display its
multiplication table into list box?

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles Button1.Click
        ListBox1.Items.Clear()
        Dim n As Integer
        Dim i As Integer
        n = InputBox("Enter Number to create table")
        For i = 1 To 10
            ListBox1.Items.Add(i * n)
        Next
    End Sub
End Class

d) Write a program in C# .net for sum of two number.


7

1. using System;  
2.   public class SumExample  
3.    {  
4.      public static void Main(string[] args)  
5.       {  
6.        int  n,sum=0,m;         
7.        Console.Write("Enter a number: ");      
8.        n= int.Parse(Console.ReadLine());     
9.        while(n>0)      
10.        {      
11.         m=n%10;      
12.         sum=sum+m;      
13.         n=n/10;      
14.        }      
15.        Console.Write("Sum is= "+sum);       
16.      }  
17.   }  
18. Enter a number: 23
19. Sum is= 5
20. Enter a number: 624
21. Sum is= 12

e) Write a program in C# .net to reverse given number.

1. using System;  
2.   public class ReverseExample  
3.    {  
4.      public static void Main(string[] args)  
5.       {  
6.        int  n, reverse=0, rem;           
7.        Console.Write("Enter a number: ");      
8.        n= int.Parse(Console.ReadLine());     
9.        while(n!=0)      
10.        {      
11.         rem=n%10;        
12.         reverse=reverse*10+rem;      
13.         n/=10;      
14.        }      
8

15.        Console.Write("Reversed Number: "+reverse);       
16.     }  
17.   } 
 

18. Output:

19. Enter a number: 234


20. Reversed Number: 432

a) What is command object?

The Command object is the heart of data processing with ADO.NET. Typically,


the Command object wraps a SQL statement or a call to a stored procedure. For example, you
might use a Command object to execute a SQL UPDATE, DELETE, INSERT, or SELECT
statement. However, ADO.NET providers that don’t represent databases may use their own
nomenclature. The only rule is that the Command.CommandText property, which defines the
command, must be a string.
As with the Connection object, the Command object is specific to the data provider. Two
examples are:
 System.Data.SqlClient.SqlCommand executes commands against SQL
Server Version 7.0 or later.
 System.Data.OleDb.OleDbCommand executes commands against an OLE
DB data provider.

b) Explain Event handing in ASP .net?

ASP.NET provides important feature event handling to Web Forms. It let us to implement event-
based model for our application. As a simple example, we can add a button to an ASP.NET Web
Forms page and then write an event handler for the button's click event. ASP.NET Web Forms
allows events on both client and server sides.

In ASP.NET Web Forms pages, however, events associated with server controls originate on the
client but are handled on the Web server by the ASP.NET.

ASP.NET Web Forms follow a standard .NET Framework pattern for event-handler methods. All
events pass two arguments: an object representing the object that raised the event, and an
event object containing any event-specific information.
9

c) Write a C# program to swap two number.

1. using System;  
2.   public class SwapExample  
3.    {  
4.      public static void Main(string[] args)  
5.       {  
6.        int  a=5, b=10;            
7.        Console.WriteLine("Before swap a= "+a+" b= "+b);    
8.        a=a*b; //a=50 (5*10)      
9.        b=a/b; //b=5 (50/10)      
10.        a=a/b; //a=10 (50/5)    
11.        Console.Write("After swap a= "+a+" b= "+b);       
12.      }  
13.   }   

Output:

Before swap a= 5 b= 10
After swap a= 10 b= 5

d) Write a vb .net program to move the text “Pune university” continuosly from left to right

Public Class MoveText

Private Sub MoveText_Load(ByVal sender As System.Object, ByVal e AsSystem.EventArgs)


Handles MyBase.

LoadTimer1.Enabled = True

End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e AsSystem.EventArgs)


Handles Timer1.Tick

Label1.Left += 1If Label1.Left >= 12000 Then


10

Timer1.Enabled = False

End If

End Sub

End Class

e) Write a C# program for multiplication of matrix.

using System;
namespace MatrixMultiplicationDemo {
   class Example {
      static void Main(string[] args) {
         int m = 2, n = 3, p = 3, q = 3, i, j;
         int[,] a = {{1, 4, 2}, {2, 5, 1}};
         int[,] b = {{3, 4, 2}, {3, 5, 7}, {1, 2, 1}};
         Console.WriteLine("Matrix a:");
         for (i = 0; i < m; i++) {
            for (j = 0; j < n; j++) {
               Console.Write(a[i, j] + " ");
      }
            Console.WriteLine();
         }
         Console.WriteLine("Matrix b:");
         for (i = 0; i < p; i++) {
            for (j = 0; j < q; j++) {
               Console.Write(b[i, j] + " ");
      }
            Console.WriteLine();
         }
         if(n! = p) {
            Console.WriteLine("Matrix multiplication not possible");
         } else {
            int[,] c = new int[m, q];
            for (i = 0; i < m; i++) {
               for (j = 0; j < q; j++) {
                  c[i, j] = 0;
                  for (int k = 0; k < n; k++) {
11

                     c[i, j] += a[i, k] * b[k, j];


         }
               }
      }
            Console.WriteLine("The product of the two matrices is :");
            for (i = 0; i < m; i++) {
               for (j = 0; j < n; j++) {
                  Console.Write(c[i, j] + "\t");
               }
               Console.WriteLine();
      }
         }
   }
   }
}

Output
The output of the above program is given as follows.
Matrix a:
142
251
Matrix b:
342
357
121
The product of the two matrices is :
172832
223540

a) Method overloading in C#.

Method overloading allows programmers to use multiple methods with the same name. The
methods are differentiated by their number and type of method arguments. Method overloading
is an example of the polymorphism feature of an object-oriented programming language.
 
Method overloading can be achieved by the following:
 By changing the number of parameters in a method
 By changing the order of parameters in a method
 By using different data types for parameters
12

b) Validation Control in ASP .net.

Validation controls are an essential part of ASP.NET web development because they help
ensure the integrity of user input. When users enter information into web forms, there is always
the potential for intentional or unintentional errors. Validation controls provide a way to check
the accuracy and validity of user input before the web application processes it.

Some of the reasons why validation controls are important in ASP.NET are:

 Preventing invalid data from being submitted: Validation controls can check for required
fields, format and type of data, and other criteria that must be met before the data can be
submitted to the server. This helps ensure that the data is accurate and complete and that
the application can process it correctly.
 Improving user experience: When users enter invalid data, they may receive error
messages or other feedback that helps them correct their mistakes. This can help prevent
frustration and improve the overall user experience.

Overall, validation controls are important for ensuring the accuracy, completeness, and security
of user input in ASP.NET web applications. In this article, learn what validation controls are in
ASP.NET and how to use them in your web application.

c) Explain Data type in vb .net.

VB.Net provides a wide range of data types. The following table shows all the data types
available −

Data Storage Allocation Value Range


Type

Boolean Depends on implementing True or False


platform

Byte 1 byte 0 through 255 (unsigned)

Char 2 bytes 0 through 65535 (unsigned)

Date 8 bytes 0:00:00 (midnight) on January 1, 0001


through 11:59:59 PM on December 31,
9999

Decimal 16 bytes 0 through +/-


79,228,162,514,264,337,593,543,950,335
13

(+/-7.9...E+28) with no decimal point; 0


through +/-
7.9228162514264337593543950335 with
28 places to the right of the decimal

You might also like