1.Write is a C# Program to calculate the length of the string. 5.Write a Vb.
5.Write a Vb.net program to check whether entered string is palindrome or not.
Using System; Write a VB.Net Program to display the numbers continuously in TextBox by
Class Program Public Class Form1
clicking c Button.
{ Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
Static void Main() System.EventArgs) Handles Button1.Click
Public Class Forml
{ Dim s As String
String s1 = “Computer”; Dim r As String
Dim counter As Integer Private Sub Form1 Load(ByVal sender As System.Object,
Console.WriteLine(“The Length of the First String is : “ +s1.Length); S = TextBox1.Text
ByVal e As System.EventArgs) Handles MyBase. Load counter = 0
String s2 = “”; R = StrReverse(s)
Console.WriteLine(“The Length of the Second String is : “ +s2.Length); If s = r Then
Timer1.Enabled = True
Console.ReadLine(); MessageBox.Show(“Enterd String is Palindrome”)
} Else
End Sub
} MessageBox.Show(“Enterd String is Not Palindrome”)
End If
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As
2.Write a C Sharp program Calculate area of circle Using System; End Sub
System.EventArgs) Handles Timer1. Tick counter counter + 1 TextBox1.Text =
Class Circle End Class
counter
{
Static void Main(string[] args) 6.Write a VB.NET program to print Yesterday’s date on screen.
End Sub
{
Console.Write(“Enter Radius: “); Imports System
End Class
Double rad = Convert.ToDouble(Console.ReadLine()); Module Module1
Double area = Math.PI * rad * rad; Sub Main()
Write a C# program to swap two number
Console.WriteLine(“Area of circle is: “ + area); Dim today As DateTime = DateTime.Now
.
} Dim yesterday As DateTime
Using System;
} yesterday = today - New TimeSpan(1, 0, 0, 0)
Public class SwapExample
Console.WriteLine("Yesterday: {0}/{1}/{2}", yesterday.Day, yesterday.Month,
{
yesterday.Year)
Public static void Main(string[] args)
4.Write a program in C# to calculate area of a square. End Sub
{
Private static void Main(string[] args) End Module
Int a=5, b=10;
{ 7.Write a VB program to find the prime numbers between 1 to100 and display it
Console.WriteLine(“Before swap a= “+a+” b= “+b);
Console.Write(“Enter Side of Square: “); onto the form
A=a*b; //a=50 (5*10)
Double side = Convert.ToDouble(Console.ReadLine()); Private Sub cmdPrime_Click()
B=a/b; //b=5 (50/10)
Double area = side*side; Dim p, n, I As Integer
A=a/b; //a=10 (50/5)
Console.WriteLine(“Area of square having side {0} is: {1}”, side,area); P=1
Console.Write(“After swap a= “+a+” b= “+b);
Console.ReadLine(); Print “Prime Numbers are : ”
} }
} For n = 1 To 100
Write a VB.Net Program to display the numbers continuously in TextBox by
For I = 2 To n – 1
clicking c Button.
If n Mod I = 0 Then
P=0
Public Class Form1
Exit For
Else
Dim counter As Integer Private Sub Form1 Load(ByVal sender As
P=1
System.Object, ByVal e As System.EventArgs) Handles MyBase. Load
End If
Counter = 0
Next
Timer1.Enabled = True
If p = 1 Then
Print n
End Sub
End If
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As
Next
System.EventArgs) Handles Timer1. Tick counter counter + 1
1) What is IDE? End Sub
TextBox1.Text = counter
Ans:- IDL (Integrated Development Environment) are software platform that
provide programmers and developers with a comprehensive set of tools for End Sub
software development in single product specifically in the .NET framework.
IDEs are built to work with specific application platforms. End Class
2) What is CLS? 8.Write a C#.net application to display the vowels from a given string
Ans:- Microsoft .Net design set of rules that have to be followed by every Using System;
Write a program in C# .net to reverse given number.
language. For programming language to communicate effectively it is Public class Demo {
Using System;
necessary that every language should ad here to the common language Public static void Main() {
Public class ReverseExample
specifications(CLS). It defines a minimum set of features that a language String myStr;
{
must implement before it is considered to be .Net compliant. Int I, len, vowel_count, cons_count;
Public static void Main(string[] args)
3) What is CTS? myStr = “Avengers”;
{
Ans:- In Microsoft's .NET Framework, the Common Type System (CTS) is a vowel_count = 0;
Int n, reverse=0, rem;
standard that specifies how type definitions and specific values of types are cons_count = 0;
Console.Write(“Enter a number: “);
represented in computer memory. It is intended to allow programs written in // find length
N= int.Parse(Console.ReadLine());
different programming languages to easily share information. As used in Len = myStr.Length;
While(n!=0)
programming languages, a type can be described as a definition of a set of For(i=0; i<len; i++) {
{
values. If(myStr[i] ==’a’ || myStr[i]==’e’ || myStr[i]==’I’ || myStr[i]==’o’ || myStr[i]==’u’ ||
Rem=n%10;
4) what is value type and reference type? myStr[i]==’A’ || myStr[i]==’E’ || myStr[i]==’I’ || myStr[i]==’O’ || myStr[i]==’U’) {
Reverse=reverse*10+rem;
Ans:- Value Type Vowel_count++;
n/=10;
A data type is a value type if it holds a data value within its own memory } else {
}
space. It means the variables of these data types directly contain values. Cons_count++;
Console.Write(“Reversed Number: “+reverse);
Reference Type }
}
Unlike value types, a reference type doesn't store its value directly. Instead, it }
Console.Write(“ }
stores the address where the value is being stored. In other words, a
reference type contains a pointer to another memory location that holds the Vowels in the string: {0}
data. “, vowel_count);
} Write a program in C# .net for sum of two number.
5) What is boxing in c#?
Ans:- Boxing is the process of converting a value type to the type object or to }
Public static void getnum()
any interface type implemented by this value type. When the common
language runtime (CLR) boxes a value type, it wraps the value inside a {
Console.Write(“Enter number: “);
System. Object instance and stores it on the managed heap.
6) What is mean by ADO.net? Int num = Int32.Parse(Console.ReadLine());
Ans:- ADO.NET is a data access technology from the Microsoft .NET
Framework that provides communication between relational and non- Console.Write(“Enter number: “);
9. Design a VB.net form to pick a date from Date Time Picker control and display Int num2 = Int32.Parse(Console.ReadLine());
relational systems through a common set of components.[1] ADO.NET is a
day, month and year in separate text boxes. }
set of computer software components that programmers can use to access
Private Sub DateTimePicker1_ValueChanged(sender As Object, e As EventArgs)
data and data services from a database. It is a part of the base class library
Handles DateTimePicker1.ValueChanged Static void Main(string[] args)
that is included with the Microsoft .NET Framework.
TextBox1.Text = DateTimePicker1.Value.Day {
7) list of any four data type in .net?
TextBox2.Text = DateTimePicker1.Value.Month Getnum();
Ans:- String, Boolean, Decimal, Char.
TextBox3.Text = DateTimePicker1.Value.Year
8) what is the use of 'this' keyword in c#?
End Class While (num!=00)
Ans:- this (C# Reference)
10. Write a program in C# swapping of two number. {
The this keyword refers to the current instance of the class and is also used
Using System; Getnum();
as a modifier of the first parameter of an extension method
Public class SwapExample Int sum = num + num2;
{ Console.WriteLine(“Sum is: “ + sum);
Public static void Main(string[] args) }
{ Console.Read()
Int a=5, b=10;
Console.WriteLine(“Before swap a= “+a+” b= “+b);
A=a*b; //a=50 (5*10)
B=a/b; //b=5 (50/10)
A=a/b; //a=10 (50/5)
Console.Write(“After swap a= “+a+” b= “+b);
}
23) Explain msg box function in details? }
Ans:- In an Access desktop database, the MsgBox Function displays a
message in a dialog box, waits for the user to click a button, and returns an
Integer indicating which button the user clicked.
Syntax
MsgBox ( prompt [, buttons ] [, title ] [, helpfile ] [, context ] )
The MsgBox function syntax has these arguments:
Argument Write a vb .net program to accept a number from user throge input box and
Description display its multiplication table into list box
prompt Public Class slip4
Required. String expression displayed as the message in the dialog box. The
maximum length of prompt is approximately 1024 characters, depending on Private Sub Button1_Click(sender As Object, e As EventArgs) Handles
the width of the characters used. If prompt consists of more than one line, Button1.Click
you can separate the lines using a carriage return character (Chr(13)), a
linefeed character (Chr(10)), or carriage return – linefeed character Dim n As Integer
combination (Chr(13) & Chr(10)) between each line.
buttons ListBox1.Items.Clear()
Optional. numeric expression that is the sum of values specifying the
number and type of buttons to display, the icon style to use, the identity of N = CInt(InputBox(“Enter number: “))
the default button, and the modality of the message box. If omitted, the
default value for buttons is 0. For I = 1 To 10
title
Optional. String expression displayed in the title bar of the dialog box. If you ListBox1.Items.Add(n * i)
omit title, the application name is placed in the title bar.
helpfile Next
Optional. String expression that identifies the Help file to use to provide
context-sensitive Help for the dialog box. If helpfile is provided, context must End Sub
also be provided. 11. Write a VB.net program for blinking an image.
context End Class
Optional. Numeric expression that is the Help context number assigned to Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
the appropriate Help topic by the Help author. If context is provided, helpfile
must also be provided PictureBox1.Visible = Not PictureBox1.Visible
24) Explain properties of text box control? End Sub
AutoCompleteMode It is used to get or set a value that indicates End Class
how the automatic completion works for the textbox control. 12.Write a C# program for multiplication of matrix
Font It is used to set the font style of the text displayed on a Windows form. Console.WriteLine(“Enter Matrix1: “)
Lines It is used to set the number of lines in a TextBox control. For I = 0 To 1 Step 1
CharacterCasing It is used to get or set a value representing whether the For j = 0 To 1 Step 1
TextBox control can modify the character's case as they typed. Console.Write(“Enter element[{0}][{1}]: “, I, j)
Multiline It is used to enter more than one line in a TextBox control, by Matrix1(I, j) = Integer.Parse(Console.ReadLine())
changing the Multiline property value from False to True. Next
AcceptsReturn It is used to get or set a value that indicates whether Next Write a program to find prime numbers bet 2 to 20.
pressing the enter button in a multiline textbox; it creates a new line of text in
control. Console.WriteLine(“Enter Matrix2: “) Dim prime, numbers, I As Integer
PasswordChar It is used to set the password character that For I = 0 To 1 Step 11) Write a VB.Net Program to display the numbers continuously in Prime = 1
can be a mask in a single line of a TextBox control. TextBox by clicking c Button. MsgBox(“The prime Numbers are : ”)
24) METHOD OVERLOADING ? Public Class Form1 For numbers = 1 To 100
Ans:- Method Overloading allows us to write different versions of a method Dim counter As Integer Private Sub Form1 Load(ByVal sender As System.Object, For I = 2 To numbers – 1
(i.e. a single class can contain more than one methods (Sub / Functions) of ByVal e As System.EventArgs) Handles MyBase. Load If numbers Mod I = 0 Then
same name but of different implementation). And compiler will Counter = 0 Prime = 0
automatically select the appropriate method based on parameters passed. Timer1.Enabled = True Exit For
25) explain pop menus in vb.net ? End Sub Else
Ans:- Popup menus are a useful metaphor. Popup menus are sometimes Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As Prime = 1
referred to as speed menus, right-click menus, or context menus. Popup System.EventArgs) Handles Timer1. Tick counter counter + 1 TextBox1.Text = End If
menus are generally invoked by right-clicking the mouse button. Based on counter
the hover location of the mouse, most applications will display a specific End Sub Next
menu. The users-focus, or context, determines which menu is shown hence End Class If prime = 1 Then
the name context menu. For j = 0 To 1 Step 1 MsgBox(numbers)
Implementing popup menus in VB6 is not necessarily intuitive but it isn’t Console.Write(“Enter element[{0}][{1}]: “, I, j) End If
hard either. There is no menu or popup menu item in VB6 that you can drag Matrix2(I, j) = Integer.Parse(Console.ReadLine()) Next
from the Toolbox onto a form—thankfully this deficit has been rectified in Next
VB.NET. This article will demonstrate how to create menus using the Menu Next
Editor in VB6 and how to use those menus as popups.
36) Inheritance?
9) What is use of CLR? 26) Event driver programing? Ans:- Inheritance is one of the fundamental attributes of object-oriented
Ans:- The Common Language Runtime (CLR) is programming that manages Ans:- Event-driven programming is a programming paradigm in which the programming. It allows you to define a child class that reuses (inherits),
the execution of programs written in any of several supported languages, flow of program execution is determined by events - for example a user extends, or modifies the behavior of a parent class. The class whose
allowing them to share common object-oriented classes written in any of the action such as a mouse click, key press, or a message from the operating members are inherited is called the base class. The class that inherits the
languages. It is a part of Microsoft's . NET Framework. system or another program. An event-driven application is designed to members of the base class is called the derived class.
10) Explain constructor and destructor inc#? detect events as they occur, and then deal with them using an C# and .NET support single inheritance only. That is, a class can only inherit
Ans:- Constructors initialize new objects, setting up initial states and appropriate event-handling procedure. The idea is an extension of from a single class. However, inheritance is transitive, which allows you to
allocating resources, while destructors clean up, releasing resources and interrupt-driven programming of the kind found in early command-line define an inheritance hierarchy for a set of types. In other words, type D can
performing necessary cleanup as objects are destroyed. environments such as DOS, and in embedded systems (where the inherit from type C, which inherits from type B, which inherits from the base
11) Explain server objet use in .net? application is implemented as firmware). class type A. Because inheritance is transitive, the members of type A are
Ans:- The Server object in Asp.NET is an instance of the System. Web. Event-driven programs can be written in any programming language, available to type D.
HttpServerUtility class. The HttpServerUtility class provides numerous although some languages(Visual Basic for example) are specifically Not all members of a base class are inherited by derived classes. The
properties and methods to perform various jobs designed to facilitate event-driven programming, and provide an following members are not inherited:
12) Explain the type of menu control? integrated development environment (IDE) that partially automates the 37) What is command object?
Ans:- A menu control allows hierarchal organization of elements associated production of code, and provides a comprehensive selection of built-in Ans:- A command object in programming typically refers to an object that
with commands and event handlers. In a typical Microsoft Windows objects and controls, each of which can respond to a range of events. encapsulates all the information needed to perform an action or trigger an
application, a menu bar contains several menu buttons (such as File, Edit, Virtually all object-oriented and visual languages support event-driven event. It's commonly used in object-oriented programming and design
and Window), and each menu button displays a menu. programming. Visual Basic, Visual C++ and Java are examples of such patterns like the Command Pattern.
13) explain connected and disconnected architecture in ado.net? languages. In this pattern, a command object represents a specific action or
Ans:- Connected Mode: remains connected to the underlying data source 27) What is Just-In-Time(JIT) Compiler in .NET operation, such as saving a file, sending a message, or executing a
while traversing in a forward-only streams of result sets. Ans:- Just-In-Time compiler(JIT) is a part of Common Language Runtime database query.
Disconnected Mode: the resultset retrieved is kept in memory and the (CLR) in .NET which is responsible for managing the execution of .NET 38) Explain CTS &CLS?
connection to the DB is no longer needed for traversal. programs regardless of any .NET programming language. A language- Ans:- CTS and CLS are parts of .NET CLR and are responsible for type
specific compiler converts the source code to the intermediate language. safety within the code. Both allow cross-language communication and type
This intermediate language is then converted into the machine code by safety. In this article, I would like to expose the relationship between these
the Just-In-Time (JIT) compiler. This machine code is specific to the two.
computer environment that the JIT compiler runs on. CLS :- CLS stands for Common Language Specification and it is a subset of
Working of JIT Compiler: The JIT compiler is required to speed up the code CTS. It defines a set of rules and restrictions that every language must
execution and provide support for multiple platforms. Its working is given follow which runs under the .NET framework. The languages which follow
as follows: these set of rules are said to be CLS Compliant. In simple words, CLS
14) Explain timer control in vb.net? The JIT compiler converts the Microsoft Intermediate Language(MSIL) or enables cross-language integration or Interoperabili.
Ans:- The timer control is a looping control used to repeat any task in a given Common Intermediate Language(CIL) into the machine code. This is
time interval. It is an important control used in Client-side and Server-side done before the MSIL or CIL can be executed.
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.
15) what is event driven programming in vb.net? 39) write steps to connect to database using ado.net?
Ans:- Event-driven programming, or event-oriented programming, is a Ans:-Step 1
paradigm where entities (objects, services, and so on) communicate First, you have to prepare database and tables. In this practice, I use
indirectly by sending messages to one another through an intermediary. The database SQL Server. The database name is "dbAdmSekolah", and I have
messages are typically stored in a queue before being handled by the table, one of which is named "tbl_Agama".
consumers. Step 2
16) list properties of array in c#? 28) What is .NET and its advantages?
Ans:- The . NET Framework provides extensive tools and class libraries Second, create a new project in Visual Studio. Then, create UI design like
Ans:- IsReadOnly - It is used to check that the Array is read-only or not. below.
IsSynchronized- It is used to check that access to the Array is synchronized that make it one of the most productive platforms for programmers. It
Step 3
or not. offers multi-language support, common APIs and other services that
Next, create connection to database SQL Server. You can open Server
Length allow developers to build high-quality applications in less time
43) how to create menu in vb.net? Explore tab --> right click on Data Connections --> and choose Add
It is used to get the total number of elements in all the dimensions of the Connection. Fill on Server Name and select a database name --> then click
Array Ans:-Let's create a MenuBar by dragging a MenuStrip control from the
toolbox and dropping it to the Windows form. Step 1. Drag the MenuStrip OK button
17) What is constructor? Step 4
Ans:- A constructor is a special method that is used to initialize objects. The control from the toolbox and drop it on to the Form. Step 2: Once the
MenuStrip is added to the form, we can set various properties of the Back to Form Agama UI design, now you can right click and choose View
advantage of a constructor, is that it is called when an object of a class is Code or you can click F7 button on the keyboard.
created. Menu by clicking on the MenuStrip control.
Step 5
18) What is any two string functions in c? 29) What is common object of .net framework?
Ans:- The common type system defines how types are declared, used, Declare string connection
Ans:- strcpy (): This function is used to copy one string to another. It takes 6
two arguments, the first argument is the destination string where the source and managed in the common language runtime, and is also an important
Then call the method on the main form
string will be copied and the second argument is the source string. part of the runtime's support for cross-language integration. The common
Click on Start to show the result.
strcat() : This function is used to concatenate two strings. type system performs the following functions:
40) Explain architecture of net framework?
19) What is the use of virtual keyword? Establishes a framework that helps enable cross-language integration,
Ans:- The .NET Framework architecture is designed to provide a
Ans:- The virtual keyword in C# allows subclasses to override methods of the type safety, and high-performance code execution.
comprehensive platform for building, deploying, and running various types
base class. This is critical for enabling polymorphism in object-oriented Provides an object-oriented model that supports the complete
implementation of many programming languages. of applications and services. Here's an overview of its architecture:
programming. This override means that if you create an instance of Dog and Common Language Runtime (CLR): At the core of the .NET Framework is
call its Speak method, you'll get "The dog barks" instead of "The animal Defines rules that languages must follow, which helps ensure that
the CLR. It manages code execution, memory management, and other
makes a sound". objects written in different languages can interact with each other.
system services. The CLR includes a just-in-time (JIT) compiler that
20) What is the use of sitemap path control? Provides a library that contains the primitive data types (such as Boolean,
converts Intermediate Language (IL) code into native machine code during
Ans:- The SiteMapPath control enables you to navigate easily to any parent Byte, Char, Int32, and UInt64) used in application development.
runtime.
page of the current page. It displays the standard breadcrumb trail that you Framework Class Library (FCL): The FCL is a collection of reusable
see on many popular websites. classes, interfaces, and value types organized into namespaces. It provides
21) Explain data gride view control? 30) Explain event handling in asp.net?
a wide range of functionality for tasks such as file I/O, networking, data
Ans:- The DataGridView control provides a powerful and flexible way to Ans:- ASP.NET provides important feature event handling to Web Forms. It
let us to implement event-based model for our application. As a simple access, security, and more
display data in a tabular format. You can use the DataGridView control to
show read-only views of a small amount of data, or you can scale it to show example, we can add a button to an ASP.NET Web Forms page and then
editable views of very large sets of data. write an event handler for the button's click event. ASP.NET Web Forms
41) explain asp.net life cycle?
You can extend the DataGridView control in a number of ways to build allows events on both client and server sides.
Ans:- When an ASP.NET page runs, the page goes through a life cycle in
custom behaviors into your applications. For example, you can In ASP.NET Web Forms pages, however, events associated with server
which it performs a series of processing steps. These include initialization,
programmatically specify your own sorting algorithms, and you can create controls originate on the client but are handled on the Web server by the
ASP.NET. instantiating controls, restoring and maintaining state, running event
your own types of cells. You can easily customize the appearance of the handler code, and rendering. It is important for you to understand the page
DataGridView control ASP.NET Web Forms follow a standard .NET Framework pattern for event-
life cycle so that you can write code at the appropriate life-cycle stage for
22) explain the architecture of asp.net? handler methods. All events pass two arguments: an object representing
the object that raised the event, and an event object the effect you intend.
Ans:- The ASP.NET Web Forms framework is based on a page-centric If you develop custom controls, you must be familiar with the page life
architecture. Each HTTP request for a location in the app is a separate page containing any event-specific information.
cycle in order to correctly initialize controls, populate control properties
with which ASP.NET responds. As pages are requested, the contents of the with view-state data, and run control behavior code. The life cycle of a
browser are replaced with the results of the page requested. 31) validation controls in ASP.NET?
control is based on the page life cycle, and the page raises many of the
Pages consist of the following components: events that you need to handle in a custom control.
HTML markup This topic contains the following sections:
C# or Visual Basic code Ans:- Validation controls are an essential part of ASP.NET web
development because they help ensure the integrity of user input. When General Page Life-cycle Stages
A code-behind class containing logic and event-handling capabilities Life-cycle Events
Controls users enter information into web forms, there is always the potential for
intentional or unintentional errors. Validation controls provide a way to Additional Page Life Cycle Considerations
Controls are reusable units of web UI that can be programmatically placed Catch-Up Events for Added Controls
and interacted with on a page. Pages are composed of files that end with check the accuracy and validity of user input before the web application
Data Binding Events for Data-Bound Controls
.aspx containing markup, controls, and some code. The code-behind classes processes it.
Login Control Events
are in files with the same base name and an .aspx.cs or .aspx.vb extension, Some of the reasons why validation controls are important in ASP.NET
depending on the programming language used. Interestingly, the web server are:
interprets contents of the .aspx files and compiles them whenever they Preventing invalid data from being submitted: Validation controls can
change. This recompilation occurs even if the web server is already running. check for required fields, format and type of data, and other criteria that
23) HTML Server Controls must be met before the data can be submitted to the server. This helps
Ans:- HTML server controls are HTML elements that contain attributes to ensure that the data is accurate and complete and that the application
accessible at server side. By default, HTML elements on an ASP.NET Web can process it correctly.
42) what is the classes of ado.net?
page are not available to the server. These components are treated as simple Improving user experience: When users enter invalid data, they may
receive error messages or other feedback that helps them correct their Ans:- ADO.NET is a set of classes (a framework) to interact with data
text and pass through to the browser. We can convert an HTML element to sources such as databases and XML files. ADO is the acronym for ActiveX
server control by adding a runat="server" and an id attribute to the mistakes. This can help prevent frustration and improve the overall user
Data Objects. It allows us to connect to underlying data or databases. It
component. experience.
has classes and methods to retrieve and manipulate data.
Now, we can easily access it at code behind. The following are a few of the .NET applications that use ADO.NET to
Example connect to a database, execute commands and retrieve data from the
<input id="UserName" type="text" size="50"runat database.
ASP.NET Web Applications
Console Applications
Windows Applications.
Various Connection Architectures
There are the following two types of connection architectures:
49) Explain data adapter in asp.net?
Connected architecture: the application remains connected with the
Ans:- DataAdapter is used to retrieve data from a data source and populate
database throughout the processing.
tables within a DataSet. The DataAdapter also resolves changes made to the
Disconnected architecture: the application automatically
DataSet back to the data source. The DataAdapter uses the Connection
connects/disconnects during the processing. The application uses
object of the .NET Framework data provider to connect to a data source, and
temporary data on the application side called a DataSet.
it uses Command objects to retrieve data from and resolve changes to the
44) Enlist and explain various objectives of .net framework?
data source.
Ans:- NET Framework is designed to fulfill the following objectives:
Each .NET Framework data provider included with the .NET Framework has a
Provide a consistent, object-oriented programming environment whether
DbDataReader and a DbDataAdapter object: the .NET Framework Data
object code is stored and executed locally, executed locally but web-
Provider for OLE DB includes an OleDbDataReader and an
distributed, or executed remotely.
OleDbDataAdapter object, the .NET Framework Data Provider for SQL Server Provide a code-execution environment that:
includes a SqlDataReader and a SqlDataAdapter object, the .NET Framework Minimizes software deployment and versioning conflicts.
Data Provider for ODBC includes an OdbcDataReader and an Promotes safe execution of code, including code created by an unknown or
OdbcDataAdapter object, and the .NET Framework Data Provider for Oracle semi-trusted third party.
includes an OracleDataReader and an OracleDataAdapter object. Eliminates the performance problems of scripted or interpreted
environments.
32) explain asp.net basic control?
Ans:- The ASP.NET page framework includes a number of built-in server
45) State and explain various statements used in vb.net?
controls that are designed to provide a more structured programming
Ans:- A statement in Visual Basic is a complete instruction. It can contain
50) Explain properties and methods of data table class? model for the Web. These controls provide the following features: keywords, operators, variables, constants, and expressions. Each
Ans:- DataTable represents relational data into tabular form. ADO.NET Automatic state management. statement belongs to one of the following categories:
provides a DataTable class to create and use data table independently. It can Simple access to object values without having to use the Request object.
Declaration Statements, which name a variable, constant, or procedure,
also be used with DataSet also. Initially, when we create DataTable, it does Ability to react to events in server-side code to create applications that
and can also specify a data type.
not have table schema. We can create table schema by adding columns and are better structured. Common approach to building user interfaces for
Executable Statements, which initiate actions. These statements can call
constraints to the table. After defining table schema, we can add rows to the web pages.
a method or function, and they can loop or branch through blocks of code.
table. Output is automatically customized based on the capabilities of the Executable statements include Assignment Statements, which assign a
We must include System.Data namespace before creating DataTable. browser. In addition to the built-in controls, the ASP.NET page framework value or expression to a variable or constant.
also provides the ability to create user controls and custom controls.
This topic describes each category. Also, this topic describes how to
User controls and custom controls can enhance and extend existing combine multiple statements on a single line and how to continue a
controls to build a much richer user interface.
statement over multiple lines.
51) what is web control ? 33) Explain data reder in aob.net? Declaration statements
Ans:- HTML server controls HTML elements exposed to the server so you Ans:- You can use the ADO.NET DataReader to retrieve a read-only,
You use declaration statements to name and define procedures, variables,
can program them. HTML server controls expose an object model that maps forward-only stream of data from a database. Results are returned as the properties, arrays, and constants. When you declare a programming
very closely to the HTML elements that they render. query executes, and are stored in the network buffer on the client until element, you can also define its data type, access level, and scope. For
Web server controls Controls with more built-in features than HTML server you request them using the Read method of the DataReader. Using the
more information, see Declared Element.
controls. Web server controls include not only form controls such as buttons DataReader can increase application performance both by retrieving data 46) What is ado. Net dataset?
and text boxes, but also special-purpose controls such as a calendar, as soon as it is available, and (by default) storing only one row at a time in
Ans:- ADO.NET DataSet is an in-memory representation of data retrieved
menus, and a tree view control. Web server controls are more abstract than memory, reducing system overhead. from a data source, typically a database. It can hold multiple tables,
HTML server controls in that their object model does not necessarily reflect A DataAdapter is used to retrieve data from a data source and populate
relationships between them, and data constraints.
HTML syntax. tables within a DataSet. The DataAdapter also resolves changes made to
Validation controls Controls that incorporate logic to enable you to what the DataSet back to the data source. The DataAdapter uses the
users enter for input controls such as the TextBox control. Validation controls Connection object of the .NET Framework data provider to connect to a
enable you to check for a required field, to test against a specific value or data source, and it uses Command objects to retrieve data from and
pattern of characters, to verify that a value lies within a range, and so on. For resolve changes to the data source.
more information, see Validation ASP.NET Controls. Each .NET Framework data provider included with the .NET Framework
has a DbDataReader and a DbDataAdapter object: the .NET Framework
34) Explain advantages of dot net?
Ans:- NET use a cross-platform framework that is compatible with all
types of platforms. The advantage of . NET is that it can perform on all
52) Explain the type of menu control? platforms including Linux, Android, and Mac. So when creating apps for
Ans:- A menu control allows hierarchal organization of elements associated Android and iOS, there is no need for developers to rewrite codes each 47) what are method and properties of server objects?
with commands and event handlers. In a typical Microsoft Windows time. Ans:- Server Object
application, a menu bar contains several menu buttons (such as File, Edit, 35) what is connection object in ado.net? The Server object in Asp.NET is an instance of the
and Window), and each menu button displays a menu. A menu contains a Ans:- A Connection object represents a unique session with a data System.Web.HttpServerUtility class. The HttpServerUtility class provides
collection of menu items (such as New, Open, and Close), which can be source. In a client/server database system, it may be equivalent to an numerous properties and methods to perform various jobs.
expanded to display additional menu items or to perform a specific action actual network connection to the server. Depending on the functionality Properties and Methods of the Server object
when clicked. supported by the provider, some collections, methods, or properties of a The methods and properties of the HttpServerUtility class are exposed
The following sections define the required UI Automation tree structure, Connection object may not be available. through the intrinsic Server object provided by ASP.NET.
properties, control patterns, and events for the Menu control type. The UI With the collections, methods, and properties of a Connection object, The following table provides a list of the properties:
Automation requirements apply to all menu controls where the UI you can do the following: Property Description
framework/platform integrates UI Automation support for control types and Configure the connection before opening it with the ConnectionString, MachineName Name of server computer
control patterns. ConnectionTimeout, and Mode properties. ConnectionString is the ScriptTimeOut Gets and sets the request time-out
default property of the Connection object. value in seconds.
Set the CursorLocation property to client to invoke the Microsoft Cursor The following table provides a list of some important methods:
Service for OLE DB, which supports batch updates. Method Description
Set the default database for the connection with the DefaultDatabase CreateObject(String) Creates an instance of the COM object
property. identified by its ProgID (Programmatic ID).
Set the level of isolation for the transactions opened on the connection CreateObject(Type) Creates an instance of the COM object
with the IsolationLevel property. identified by its Type.
Specify an OLE DB provider with the Provider property Equals(Object) Determines whether the specified Object is equal to
the current Object.
Execute(String) Executes the handler for the specified virtual
path in the context of the current request.
48) write string functions in c#?
Ans:- In C#, string is an object of System.String class that represent
sequence of characters. We can perform many operations on strings such
as concatenation, comparision, getting substring, search, trim,
replacement etc.
string vs String In C#, string is keyword which is an alias for System.String
class. That is why string and String are equivalent. We are free to use any
naming convention.
string s1 = "hello";//creating string using string keyword String s2 =
"welcome";//creating string using String