604 Ca
604 Ca
Q1)
CLR (Common Language Runtime) is the execution engine for .NET applications. It:
Manages memory.
Handles exceptions.
b) What is CTS?
CTS (Common Type System) standardizes data types across .NET languages (like VB.NET, C#). It
ensures:
Type compatibility.
i) MessageBox() – Displays a pop-up dialog box with a message, and optionally buttons
like OK/Cancel.
MessageBox.Show("Operation successful!")
ii) InputBox() – Prompts the user to enter input via a pop-up dialog.
pg. 1
e) Explain this keyword in C#:
The this keyword refers to the current instance of the class. It is used:
this.name = name;
}
}
Constructor – Special method that initializes a new object. Same name as class, no
return type.
Destructor – Cleans up resources. Declared with ~ClassName() and called by the garbage
collector.
o MainMenu
o ContextMenu
pg. 2
o MenuStrip Used for displaying a list of menu items for user interaction.
Disconnected – Uses DataSet and DataAdapter to fetch data, work offline, and update
back later.
Timer1.Start()
Q1 Continued
+ – Can also concatenate strings but might cause ambiguity with numeric addition.
pg. 3
Initializes object state.
public MyClass() {
// Initialization code
}
A DataSet:
Integer
String
Double
Boolean
pg. 4
h) List any four common web controls:
TextBox
Label
DropDownList
Button
Displays a breadcrumb navigation to show the current page location within the site hierarchy.
Items
SelectedIndex
SelectedItem
DropDownStyle
Q1 Continued
Automatic memory management that reclaims memory used by unused objects, managed by
the CLR.
Syntax Error
Runtime Error
pg. 5
Logical Error
Compile-time Error
d) Define MSIL:
Text
BackColor
StartPosition
WindowState
f) What is CLS?
Common Language Specification – Defines rules to ensure interoperability across all .NET
languages.
Defining multiple methods with the same name but different parameters.
void Print() {}
h) What is destructor?
A method that is called when an object is destroyed, used for cleanup in C#.
~MyClass() {
// cleanup code
pg. 6
i) What is event? List two mouse events in VB.NET
Mouse Events:
MouseClick
MouseHover
Q2)
Types:
Important Properties:
pg. 7
Minimum, Maximum – Range values.
Methods:
Example Usage:
End Sub
c) ADO.NET Components:
Design:
RichTextBox: RichTextBox1
ComboBox: ComboBox1
Button: Button1
pg. 8
Code:
End Sub
End If
End Sub
count += 1
End Sub
Q3)
If "aeiou".Contains(ch) Then
MessageBox.Show("Vowel")
pg. 9
Else
MessageBox.Show("Consonant")
End If
End Sub
int sum = 0;
sum += num;
int a = 0, b = 1, c;
c = a + b;
a = b;
b = c;
pg. 10
for (int i = 2; i <= Math.Sqrt(num); i++) {
if (num % i == 0) {
isPrime = false;
break;
sum += i
End If
Next
MessageBox.Show("Perfect Number")
Else
MessageBox.Show("Not Perfect")
End If
Q4)
pg. 11
a) Built-in Dialog Boxes in VB.NET/Windows Forms:
Types:
End Sub
pg. 12
Add a PictureBox with an image.
int[] arr = { 5, 2, 8, 1, 3 };
Array.Sort(arr);
Q2)
Definition: DataGridView is a control in Windows Forms that allows you to display, edit,
and manipulate tabular data.
Key Features:
Common Properties:
Common Methods:
o Refresh(), ClearSelection()
pg. 13
2. Server Controls: Buttons, Labels, TextBoxes—used to design web UI.
4. HTTP Pipeline:
Properties:
Methods:
pg. 14
Syntax in VB.NET:
Parameters:
pg. 15
6. ASP.NET and Windows Forms
Examples:
ASP.NET provides several server-side controls that extend HTML controls with server processing
capabilities:
pg. 16
Example:
con.Open()
Important Properties:
o ConnectionString, State
Important Methods:
o Open(), Close()
Example in VB.NET:
While dr.Read()
Console.WriteLine(dr("Name"))
End While
Properties:
Methods:
o Read(), Close()
Q5 - Short Notes
a) Method Overloading in C#
pg. 17
Method Overloading allows multiple methods in the same class to have the same name
but different parameter lists (type, number, or order).
Example:
Reference types:
Example:
pg. 18
Dim age As Integer = 25
Programming paradigm where events (click, keypress, etc.) trigger code execution.
Example:
MessageBox.Show("Button Clicked!")
End Sub
Types:
o Normal JIT
o Econo JIT
o Pre-JIT (Ngen.exe)
c) Method Overloading
Method Overloading allows multiple methods in the same class to have the same
name but different parameter lists (type, number, or order).
pg. 19
Example:
a) Crystal Reports
A reporting tool to design, generate, and format rich reports from databases.
b) Conductor
Kindly clarify if it's from a specific context (like WPF, software architecture, or physical
computing).
c) Command Object
Example in VB.NET:
cmd.ExecuteReader()
pg. 20