Thursday 9 July 2009

Ado dot net questions

1. What is dataset?
Ans:
Dataset is like a recordset, when we get any result from datasource, dataset fill it self with the result and destroy the connection from datasource. It is also called disconnected datasource. It remove the over head of maintaining connection with the database, but can make application slow where there is large sum of results.

2. What is difference between dataset and datareader?
Ans :
a. Datareaders are connection oriented. Datasets support not connection oriented.
b. Datareaders are readonly and forward only whereas datasets are used to maintain relationships between multipletables.
c. Data Reader can't persist the dataData Set can persist the data.
d.We can't do DML operations through datareader.Whereas in dataset(disconnected) model which we can do all the DML operations.
e.Using Data Reader only one value can be accessed from the
database whereas using Dataset you can access a any number
of values from the database.
f. Datareader operation is faster than dataset operation.

3.Why DataReader is Forward Only?
DataReaader is connected object and one can process the rows that are returned by query, one at a time.

4. What is the difference between typed and untyped dataset?
a. Typed dataset is one where structure of dataset is defined by the programmer irrespective of the database structure.
Untyped datasets are one where the dataset is totally similar to the structure of database table.
b.Typed datasets can be used easily for programming practices.
c. For serious projects we use typed datasets only.
For a simple tasks can be done with untyped ones.
5.