Dotnet Framework Q&A SEM VI 2022-2023
Dotnet Framework Q&A SEM VI 2022-2023
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).
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.
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:
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:
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.
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.
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.
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.
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.
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
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
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.
With the collections, methods, and properties of a Connection object, you can do the following:
Set the level of isolation for the transactions opened on the connection with
the IsolationLevel property.
Establish, and later break, the physical connection to the data source with
the Open and Close methods.
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.ReadLine()
6
End Sub
End Module
Output:
Enter Your first number : 10
Enter Your Second number : 30
Here Largest Number is: 30
Public Class Form1
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
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
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:
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
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
LoadTimer1.Enabled = True
End Sub
Timer1.Enabled = False
End If
End Sub
End Class
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
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
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
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.
VB.Net provides a wide range of data types. The following table shows all the data types
available −