0% found this document useful (0 votes)
23 views20 pages

604 Ca

The document provides an overview of the .NET Framework, including key components such as CLR, CTS, and ADO.NET, along with various controls and programming concepts in VB.NET and C#. It covers topics like memory management, exception handling, data types, and user interface controls. Additionally, it discusses features of the .NET Framework, ASP.NET life cycle events, and examples of common programming tasks.

Uploaded by

Santosh Gobhe
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 (0 votes)
23 views20 pages

604 Ca

The document provides an overview of the .NET Framework, including key components such as CLR, CTS, and ADO.NET, along with various controls and programming concepts in VB.NET and C#. It covers topics like memory management, exception handling, data types, and user interface controls. Additionally, it discusses features of the .NET Framework, ASP.NET life cycle events, and examples of common programming tasks.

Uploaded by

Santosh Gobhe
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/ 20

DOT NET FRAMEWORKING

Q1)

a) What is the use of CLR?

CLR (Common Language Runtime) is the execution engine for .NET applications. It:

 Manages memory.

 Handles exceptions.

 Performs garbage collection.

 Enforces type safety.

 Provides security and thread management.

b) What is CTS?

CTS (Common Type System) standardizes data types across .NET languages (like VB.NET, C#). It
ensures:

 Type compatibility.

 Code interoperability between languages.

c) Enlist any two operators in VB.NET

 & — String Concatenation

 + — Addition or String Concatenation (context-sensitive)

d) Explain following functions:

 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.

 Dim name As String = InputBox("Enter your name:")

pg. 1
e) Explain this keyword in C#:

The this keyword refers to the current instance of the class. It is used:

 To access members of the current class.

 To differentiate between instance variables and parameters.

 public class Student {

 private string name;

 public Student(string name) {

 this.name = name;

 }

 }

f) Explain constructor and destructor in C#:

 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.

g) Explain Server object:

In ASP.NET, Server is an object of the HttpServerUtility class that provides:

 Utility methods like Server.MapPath()

 Server-side execution (Server.Execute())

h) Explain types of menu control:

 Menu Control in ASP.NET or Windows Forms can be:

o MainMenu

o ContextMenu

pg. 2
o MenuStrip Used for displaying a list of menu items for user interaction.

i) Explain Connected and Disconnected Architecture in ADO.NET:

 Connected – Uses SqlDataReader to access data while maintaining connection.

 Disconnected – Uses DataSet and DataAdapter to fetch data, work offline, and update
back later.

j) Explain Timer control in VB.NET:

 Executes code at regular intervals.

 Can be used for animations, clocks, or periodic tasks.

 Timer1.Interval = 1000 ' 1 second

 Timer1.Start()

Q1 Continued

a) Enlist concatenation operators in VB.NET

 & – Preferred for string concatenation.

 + – Can also concatenate strings but might cause ambiguity with numeric addition.

b) List properties of Array in C#:

 Length – Total number of elements.

 Rank – Number of dimensions.

 GetUpperBound(int dimension) – Highest index.

 IsFixedSize, IsReadOnly – Metadata about the array structure.

c) What do you mean by constructor?

A constructor is a special method that:

pg. 3
 Initializes object state.

 Has no return type and same name as the class.

 public MyClass() {

 // Initialization code

 }

d) What is ADO.Net Dataset?

A DataSet:

 Is an in-memory representation of data.

 Can contain multiple DataTables.

 Is disconnected from the data source.

e) Write any two string functions in C#:

 Length – Returns number of characters.

 Substring(startIndex, length) – Extracts a portion of a string.

f) Enlist any four data types used in VB.NET:

 Integer

 String

 Double

 Boolean

g) What is the use of virtual keyword?

 Allows a method/property to be overridden in a derived class.

 public virtual void Display() { ... }

pg. 4
h) List any four common web controls:

 TextBox

 Label

 DropDownList

 Button

i) What is the use of SiteMapPath control?

Displays a breadcrumb navigation to show the current page location within the site hierarchy.

j) List any four properties of ComboBox control:

 Items

 SelectedIndex

 SelectedItem

 DropDownStyle

Q1 Continued

a) How to declare a constant?

Const PI As Double = 3.14

b) What is garbage collection?

Automatic memory management that reclaims memory used by unused objects, managed by
the CLR.

c) Enlist any four errors in VB.NET:

 Syntax Error

 Runtime Error

pg. 5
 Logical Error

 Compile-time Error

d) Define MSIL:

Microsoft Intermediate Language – Code generated after compilation, platform-independent,


later converted to machine code by CLR.

e) List any 4 properties of Form:

 Text

 BackColor

 StartPosition

 WindowState

f) What is CLS?

Common Language Specification – Defines rules to ensure interoperability across all .NET
languages.

g) What is method overloading?

Defining multiple methods with the same name but different parameters.

void Print() {}

void Print(string msg) {}

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

An event is a user or system action that a program responds to.

Mouse Events:

 MouseClick

 MouseHover

Q2)

a) Features of .NET Framework:

1. Cross-Language Interoperability – Code written in different languages (C#, VB.NET) can


interact.

2. Common Language Runtime (CLR) – Manages execution, memory, threads, and


exceptions.

3. Base Class Library (BCL) – Rich collection of reusable classes.

4. Security – Role-based and code access security.

5. Garbage Collection – Automatic memory management.

6. Platform Independence – MSIL is JIT compiled to native code.

7. Web, Windows, and Console Application Support.

8. ADO.NET – For data access.

9. Windows Forms and WPF – For GUI-based applications.

10. ASP.NET – For building dynamic web apps.

b) ScrollBar Control in VB.NET:

Types:

 HScrollBar – Horizontal scrollbar.

 VScrollBar – Vertical scrollbar.

Important Properties:

pg. 7
 Minimum, Maximum – Range values.

 Value – Current value.

 SmallChange – Increment on small step.

 LargeChange – Increment on large step.

Methods:

 PerformScroll – Forces scroll event.

 Refresh() – Redraws scrollbar.

Example Usage:

Private Sub VScrollBar1_Scroll(sender As Object, e As ScrollEventArgs) Handles


VScrollBar1.Scroll

TextBox1.Text = "Scrolled Value: " & VScrollBar1.Value

End Sub

c) ADO.NET Components:

1. Connection Object – (SqlConnection) Opens connection to DB.

2. Command Object – (SqlCommand) Executes SQL queries.

3. DataReader – (SqlDataReader) Reads data in forward-only mode.

4. DataAdapter – Bridges between DataSet and database.

5. DataSet – In-memory cache of data.

6. DataTable – Represents a single table of in-memory data.

d) GUI with RichTextBox and Font Size ComboBox in VB.NET

Design:

 RichTextBox: RichTextBox1

 ComboBox: ComboBox1

 Button: Button1

pg. 8
Code:

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

ComboBox1.Items.AddRange(New Object() {"8", "10", "12", "14", "16", "18", "20"})

End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

If ComboBox1.SelectedItem IsNot Nothing Then

Dim newSize As Single = Convert.ToSingle(ComboBox1.SelectedItem)

RichTextBox1.SelectionFont = New Font(RichTextBox1.Font.FontFamily, newSize)

End If

End Sub

e) VB.NET Program – Display Numbers Continuously in TextBox

Private count As Integer = 1

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

TextBox1.Text &= count.ToString() & " "

count += 1

End Sub

Q3)

a) VB.NET – Check Vowel or Consonant

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

Dim ch As Char = TextBox1.Text.ToLower()(0)

If "aeiou".Contains(ch) Then

MessageBox.Show("Vowel")

pg. 9
Else

MessageBox.Show("Consonant")

End If

End Sub

b) C#.NET – Sum of Array Elements

int[] numbers = {1, 2, 3, 4, 5};

int sum = 0;

foreach (int num in numbers) {

sum += num;

Console.WriteLine("Sum: " + sum);

c) C#.NET – Fibonacci Series

int a = 0, b = 1, c;

Console.Write(a + " " + b + " ");

for (int i = 2; i < 10; i++) {

c = a + b;

Console.Write(c + " ");

a = b;

b = c;

d) C#.NET – Check Prime Number

int num = 17;

bool isPrime = true;

pg. 10
for (int i = 2; i <= Math.Sqrt(num); i++) {

if (num % i == 0) {

isPrime = false;

break;

Console.WriteLine(isPrime ? "Prime" : "Not Prime");

e) VB.NET – Check Perfect Number

Dim number As Integer = 28

Dim sum As Integer = 0

For i As Integer = 1 To number - 1

If number Mod i = 0 Then

sum += i

End If

Next

If sum = number Then

MessageBox.Show("Perfect Number")

Else

MessageBox.Show("Not Perfect")

End If

Q4)

pg. 11
a) Built-in Dialog Boxes in VB.NET/Windows Forms:

1. OpenFileDialog – Opens files.

2. SaveFileDialog – Saves files.

3. FontDialog – Selects font.

4. ColorDialog – Picks color.

5. PrintDialog – Prints documents.

b) ASP.NET Life Cycle Events:

1. Application Start – When the app starts.

2. BeginRequest – Start of an HTTP request.

3. AuthenticateRequest – Authentication performed.

4. AuthorizeRequest – Authorization check.

5. Page Init, Load, Render, Unload – Page-specific events.

6. Application End – Application shutdown.

c) ASP.NET Validation + 2 Types:

Validation ensures data entered by the user is correct.

Types:

 RequiredFieldValidator – Ensures field is not empty.

 RangeValidator – Checks input is within specified range.

d) VB.NET – Blink an Image

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick

PictureBox1.Visible = Not PictureBox1.Visible

End Sub

 Add a Timer with Interval = 500 and enable it.

pg. 12
 Add a PictureBox with an image.

e) C#.NET – Sort an Array

int[] arr = { 5, 2, 8, 1, 3 };

Array.Sort(arr);

foreach (int i in arr)

Console.Write(i + " ");

Q2)

a) Explain DataGridView Control

 Definition: DataGridView is a control in Windows Forms that allows you to display, edit,
and manipulate tabular data.

 Key Features:

o Supports data binding with datasets, tables, lists.

o Column sorting, editing, and styling.

o Auto-resizing of columns and rows.

o Custom cell formatting and event handling.

 Common Properties:

o DataSource: Binds to data.

o ReadOnly: Makes grid non-editable.

o AllowUserToAddRows, AllowUserToDeleteRows: Enable/disable row operations.

 Common Methods:

o Refresh(), ClearSelection()

b) Explain the architecture of ASP.Net

ASP.NET follows a layered architecture:

1. Page Life Cycle: Events like Init, Load, PreRender, Unload.

pg. 13
2. Server Controls: Buttons, Labels, TextBoxes—used to design web UI.

3. Code Behind: Separates logic from UI.

4. HTTP Pipeline:

o Request → IIS → HTTP Module → HTTP Handler → Page → Response

5. Compilation: Dynamic compilation of pages into assemblies.

6. State Management: ViewState, Session, Cookies, QueryString.

7. Security: Authentication (Forms, Windows), Authorization.

c) Explain classes in ADO.Net

Classes in ADO.NET are divided into:

 Connection classes: SqlConnection, OleDbConnection

 Command classes: SqlCommand, OleDbCommand

 DataReader classes: SqlDataReader, OleDbDataReader (for connected architecture)

 DataAdapter: Fills DataSet from DB (used in disconnected architecture)

 DataSet: In-memory data storage

 DataTable, DataRow, DataColumn: Used to handle individual data units.

d) Properties and Methods of Server Object

 Used in ASP.NET for accessing server-level utilities.

 Properties:

o Server.MachineName: Server's name.

o Server.ScriptTimeout: Request timeout.

 Methods:

o Server.HtmlEncode(): Encodes HTML characters.

o Server.UrlEncode(): Encodes URL strings.

o Server.MapPath(): Returns physical path of virtual directory.

e) Explain MessageBox Function in Detail

 Purpose: To display a message/dialog box to the user.

pg. 14
 Syntax in VB.NET:

 MessageBox.Show("Message", "Title", MessageBoxButtons.YesNo,


MessageBoxIcon.Information)

 Parameters:

o Message: Text to show.

o Title: Title bar text.

o Buttons: OK, Cancel, YesNo, etc.

o Icon: Error, Warning, Info, etc.

 Returns: A DialogResult value based on button click.

Q2) .NET Framework and ADO.NET Concepts

a) Explain Architecture of .NET Framework

.NET Framework has a multi-layered architecture consisting of:

1. Common Language Runtime (CLR)

o Core engine that executes .NET programs.

o Provides services like memory management, security, garbage collection, and


exception handling.

2. .NET Framework Class Library (FCL)

o A vast library of pre-built classes and interfaces.

o Includes namespaces like System, System.IO, System.Data, System.Web, etc.

3. Languages (C#, VB.NET, F#)

o Allows development in multiple languages that are compiled to Common


Intermediate Language (CIL).

4. Common Type System (CTS)

o Standardizes data types across all .NET languages.

5. Common Language Specification (CLS)

o A set of rules for language interoperability.

pg. 15
6. ASP.NET and Windows Forms

o ASP.NET for web applications.

o Windows Forms/WPF for desktop applications.

b) What are HTML Controls?

 HTML controls are the basic elements of a web page.

 Examples:

o <input>, <button>, <textarea>, <select>, <form>, <label>, etc.

 They are client-side controls and don’t retain state by themselves.

 In ASP.NET, they can be run as server-side controls using runat="server".

c) Explain ASP.NET Basic Controls

ASP.NET provides several server-side controls that extend HTML controls with server processing
capabilities:

1. Label – Displays text.

2. TextBox – Accepts user input.

3. Button – Triggers a postback and executes event.

4. CheckBox / RadioButton – For options and selections.

5. DropDownList – Drop-down selection list.

6. ListBox – Displays list of items.

7. GridView – Displays and edits tabular data.

8. Calendar – Date selection.

d) What is Connection Object in ADO.NET?

 A Connection Object establishes a connection between an application and a data


source.

 In SQL Server, we use SqlConnection.

pg. 16
 Example:

 Dim con As New SqlConnection("connection_string")

 con.Open()

 Important Properties:

o ConnectionString, State

 Important Methods:

o Open(), Close()

e) Explain DataReader in ADO.NET

 DataReader is used to read data from a database in a forward-only, read-only manner.

 Connected architecture component.

 High-performance way to read data row-by-row.

 Example in VB.NET:

 Dim cmd As New SqlCommand("SELECT * FROM Students", con)

 Dim dr As SqlDataReader = cmd.ExecuteReader()

 While dr.Read()

 Console.WriteLine(dr("Name"))

 End While

 Properties:

o HasRows, Item, FieldCount

 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).

 Enhances code readability and reusability.

 Compiler selects the appropriate method based on arguments.

 Example:

 public void Display(int a) { ... }

 public void Display(string a) { ... }

 public void Display(int a, int b) { ... }

b) Validation Controls in ASP.NET

 Used to validate user input before processing.

 Can be client-side or server-side.

 Common validation controls:

1. RequiredFieldValidator – Ensures the field is not empty.

2. RangeValidator – Ensures input falls within a specific range.

3. CompareValidator – Compares values of two controls.

4. RegularExpressionValidator – Validates input against regex pattern.

5. CustomValidator – Allows custom validation logic.

c) Data Types in VB.NET

 VB.NET provides both value types and reference types.

 Common value types:

o Integer, Double, Boolean, Char, Date

 Reference types:

o String, Array, Object, Class

 Example:

pg. 18
 Dim age As Integer = 25

 Dim name As String = "John"

a) Event Driven Programming

 Programming paradigm where events (click, keypress, etc.) trigger code execution.

 Common in GUI development (VB.NET, Windows Forms, ASP.NET).

 Events are handled using event handlers.

 Example:

 Private Sub btnClick_Click(...) Handles btnClick.Click

 MessageBox.Show("Button Clicked!")

 End Sub

b) JIT Compilers (Just-In-Time)

 Part of the CLR in .NET.

 Converts MSIL (Intermediate Language) to native machine code at runtime.

 Improves performance and enables runtime optimizations.

 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).

 Enhances code readability and reusability.

 Compiler selects the appropriate method based on arguments.

pg. 19
 Example:

public void Display(int a) { ... }

public void Display(string a) { ... }

public void Display(int a, int b) { ... }

a) Crystal Reports

 A reporting tool to design, generate, and format rich reports from databases.

 Can be integrated with VB.NET, C#, and ASP.NET.

 Supports charts, graphs, and export to PDF, Excel, etc.

b) Conductor

 If from .NET perspective: no direct meaning in .NET.

 In general tech context, it could refer to a controller or orchestrator in workflow or


infrastructure management.

 Kindly clarify if it's from a specific context (like WPF, software architecture, or physical
computing).

c) Command Object

 ADO.NET component used to execute SQL queries or stored procedures.

 Works with Connection and DataReader.

 Example in VB.NET:

 Dim cmd As New SqlCommand("SELECT * FROM Students", con)

 cmd.ExecuteReader()

 Important properties: CommandText, CommandType, Connection

pg. 20

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy