You are on page 1of 5

Que 1: Difference Between ADO & ADO.

NET
ADO and ADO.NET are different in several ways:

ADO works with connected data. This means that when you access data, such as viewing and updating data, it is real-time, with a connection being used all the time. This is barring, of course, you programming special routines to pull all your data into temporary tables. ADO.NET uses data in a disconnected fashion. When you access data, ADO.NET makes a copy of the data using XML. ADO.NET only holds the connection open long enough to either pull down the data or to make any requested updates. This makes ADO.NET efficient to use for Web applications. It's also decent for desktop applications.

ADO has one main object that is used to reference data, called the Recordset object. This object basically gives you a single table view of your data, although you can join tables to create a new set of records. With ADO.NET, you have various objects that allow you to access data in various ways. The DataSet object will actually allow you to store the relational model of your database. This allows you to pull up customers and their orders, accessing/updating the data in each related table individually.

ADO allows you to create client-side cursors only, whereas ADO.NET gives you the choice of either using client-side or server-side cursors. In ADO.NET, classes actually handle the work of cursors. This allows the developer to decide which is best. For Internet development, this is crucial in creating efficient applications.

Whereas ADO allows you to persist records in XML format, ADO.NET allows you to manipulate your data using XML as the primary means. This is nice when you are working with other business applications and also helps when you are working with firewalls because data is passed as HTML and XML.

Que 2: Data types of SQL Server

Data Type
bigint

Description Integer (whole number) data from -263 (9,223,372,036,854,775,808) through 263\up6 - 1\up6 (9,223,372,036,854,775,807). Integer (whole number) data from -2^31 (2,147,483,648) through 231 - 1 (2,147,483,647). Integer data from 215 (-32,768) through 215 - 1 (32,767). Integer data from 0 through 255. Integer data with either a 1 or 0 value. Fixed precision and scale numeric data from -1038 + 1 through 1038 - 1. Functionally equivalent to decimal. Monetary data values from -263 (922,337,203,685,477.5808) through 263 - 1 (+922,337,203,685,477.5807), with accuracy to a tenthousandth of a monetary unit. Monetary data values from -214,748.3648 through +214,748.3647, with accuracy to a ten-thousandth of a monetary unit. Floating precision number data from -1.79E + 308 through 1.79E + 308. Floating precision number data from -3.40E + 38 through 3.40E + 38. Date and time data from January 1, 1753, through December 31, 9999, with an accuracy of threehundredths of a second, or 3.33 milliseconds. Date and time data from January 1, 1900, through June 6, 2079, with an accuracy of one minute. Fixed-length non-Unicode character data with a

int

smallint tinyint bit decimal

numeric money

smallmoney

float

real

datetime

smalldatetime

char

maximum length of 8,000 characters.


varchar

Variable-length non-Unicode data with a maximum length of 8,000 characters. Variable-length non-Unicode data with a maximum length of 231 - 1 (2,147,483,647) characters. Fixed-length Unicode data with a maximum length of 4,000 characters. Variable-length Unicode data with a maximum length of 4,000 characters. Variable-length Unicode data with a maximum length of 230 - 1 (1,073,741,823) characters. Fixed-length binary data with a maximum length of 8,000 bytes. Variable-length binary data with a maximum length of 8,000 bytes. Variable-length binary data with a maximum length of 231 - 1 (2,147,483,647) bytes. A reference to a cursor. A data type that stores values of various SQL Serversupported data types, except text, ntext, timestamp, and sql_variant. A special data type that stores a result set for later processing. A database-wide unique number that is updated every time a row is updated. A globally unique identifier (GUID).

text

nchar

nvarchar

ntext

binary

Varbinary

image

cursor sql_variant

table

timestamp

uniqueidentifier

Que: ADO.NET Data Objects That Are Used to Manipulate Data

Object
DataSet

Purpose This object is used in conjunction with the other data controls, storing the results

that are returned by commands and the data adapters. Unlike the recordset from ADO and DAO, the data set actually brings back a hierarchical view of the data. Using properties and collections in the DataSet object, you can get overall relations, individual tables, rows, and columns.
DataTable

One of the objects off of the data set, the DataTable object enables you to manipulate an individual table's worth of data. The data table is similar to the recordset object that is found in ADO. Using this object, you can filter and sort your data, keeping various views of the data. Each data table has a default view, which is the starting data view that can be modified and stored in a separate data view. This object enables you to manipulate the rows of data in your data tables. This can be thought of as a cache of data that you can manipulate by adding, deleting, and modifying records. You can then accept the changes back to the recordset, where you will then run SQL statements to update data back at the server. As the name suggests, you can get information at the column level by using the DataColumn object. You can get schema information as well as data using this object. For example, if you want to create a list box of names of fields, you could iterate through the DataColumn collection off a data row and retrieve all the names of the fields. This object allows you to specify a primary key for a data table. That way, when you use the Find method of the data table, it knows which column to use.

DataView

DataRow

DataColumn

PrimaryKey

Que:

NET Data Provider Classes That Are Used to Manipulate Data

Object
Command

Purpose Similar to the ADO Command object, this allows you to execute stored procedures in code. Unlike the ADO version, however, you can create a DataReader object using the ExecuteReader method. This object opens a connection to the server and database with which you want to work. Unlike the ADO Connection object, the way that the connection remains open depends on the object with which you are working, such as a DataReader or DataSet object. A real workhorse, the DataAdapter object allows you to create SQL statements and fill datasets with the data. It also creates other necessary action queries, such

Connection

DataAdapter

as Insert, Update, and Delete ADO.NET command objects.


DataReader

This object creates a read-only, forward-only stream of data that allows you to quickly populate controls, such as ListBox and ComboBox controls. This object allows you to specify the parameter (or parameters if you use more than one) that DataAdapter objects can specify and use.

Parameter

Que:

Types of Reports Created by the Report Expert

Report Type Crosstab

Description Crosstab reports give you a cross-tabulation of your data, such as sales of customers by years.

Drill Down This report is broken down into sections that start out as hidden, and then allow the user to "drill down" further into the information. An example of this would be a report that lists customers. When the user clicks on a particular customer, the invoices for that customer are displayed. Next, when you click on a particular invoice, its line items (or details) can be displayed. Form Form Letter Mail Labels Standard This report helps to create preprinted forms that use company logos and forms. Examples of this type include invoices. Forms letters, such as late notices and sales letters, are created using this expert. This expert allows you to create mailing labels that are any size and any number of columns. The standard report is just that-a standard list report that lists your information. It allows you to group and sort information, include formulas, and set an overall format for the report. This is the report that will be demonstrated for this How-To. This report helps you to create main reports that utilize subreports. An example is invoices for customers.

SubReport

You might also like