Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 4

Q1):What is ADO .NET and what is difference between ADO and ADO.NET?

ADO.NET is stateless mechanism. I can treat the ADO.Net as a separate in-memory


database where in I can use relationships between the tables and select insert and updates
to the database. I can update the actual database as a batch.

Q2):What is DataBinding?
Data binding refers to the process of dynamically assigning a value to a property of a
control at runtime. For example, you can use data binding to bind the properties of a
control to a data source such as the contents of a SQL Server database table.

Q3):What is an Object?
An object is an instance of a class.

Instances are created by declaring a variable of the class type to hold a reference
to an instance (or object) of that class.
Instantiate or create a new instance of a class using the new keyword.

Q4):Explain about Repeater Controls?


The Repeater control does not display anything unless it is bound to a data source.
Typically, you use the Repeater control to display the records from a database table,
although you can also bind the control to other data sources such as collections.

Q5):Explain about DataReader?


The DataReader, therefore, cannot be used to work with the results of a database query as
a whole. For example, you cannot sort, or filter, or retrieve a count of the number of
records in a DataReader because only one record from a database query is represented by
a DataReader at a time.

Q6):Explain about DataSet?

A DataSet enables you to represent the results of a database query in your server's
memory. Because a DataSet provides you with a memory-resident representation of data,
you can work with the results of a database query as a whole. For example, a DataSet
includes methods for sorting, filtering, and returning a count of the records from a
database query.A DataSet can contain one or more DataTables that represent database
tables. Relationships between the tables (such as parent/child relationships) can be
defined using DataRelation classes. Finally, a DataView represents a particular filtered or
sorted view of a DataTable.

Q7):Explain about DataAdapter?


The DataAdapter class represents the bridge between a DataSet and the data source it
represents. You use a DataAdapter to populate a DataSet from an existing database table.
You can also use a DataAdapter to update an existing database table with changes made
to a DataSet.
Q8):Explain about DataTable?
A DataTable is a memory-resident representation of a database table in a DataSet. In the
following sections, you will learn how to work with the properties and methods of a
DataTable. For example, you will learn how to retrieve key and schema information for a
DataTable, create relationships between multiple DataTables in a DataSet, and update the
rows in a DataTable.

Q9):Explain about DataView?


A DataView represents a particular view on a DataTable. You can use a DataView to
display a filtered and sorted view of the rows in a DataTable. You also can use a
DataView to find rows that have certain column values in a DataTable.

Q10):What is the Use of DataGrid Control?


DataGrid control used toa display, edit, sort, and page through database data.
Re: Difference between DataReader and DataAdapter / DataSet and DataAdapter?
Answer
#1
Lets take a look at the differences between ADO Recordset
and ADO.Net DataSet:
1. Table Collection: ADO Recordset provides the ability to

navigate through a single table of information. That table


would have been formed with a join of multiple tables and
returning columns from multiple tables. ADO.NET DataSet is
capable of holding instances of multiple tables. It has got
a Table Collection, which holds multiple tables in it. If
the tables are having a relation, then it can be manipulated
on a Parent-Child relationship. It has the ability to
support multiple tables with keys, constraints and
interconnected relationships. With this ability the DataSet
can be considered as a small, in-memory relational database
cache.
2. Navigation: Navigation in ADO Recordset is based on the
cursor mode. Even though it is specified to be a client-side
Recordset, still the navigation pointer will move from one
location to another on cursor model only. ADO.NET DataSet is
an entirely offline, in-memory, and cache of data. All of
its data is available all the time. At any time, we can
retrieve any row or column, constraints or relation simply
by accessing it either ordinarily or by retrieving it from a
name-based collection.
3. Connectivity Model: The ADO Recordset was originally
designed without the ability to operate in a disconnected
environment. ADO.NET DataSet is specifically designed to be
a disconnected in-memory database. ADO.NET DataSet follows a
pure disconnected connectivity model and this gives it much
more scalability and versatility in the amount of things it
can do and how easily it can do that.
4. Marshalling and Serialization: In COM, through
Marshalling, we can pass data from 1 COM component to
another component at any time. Marshalling involves copying
and processing data so that a complex type can appear to the
receiving component the same as it appeared to the sending
component. Marshalling is an expensive operation. ADO.NET
Dataset and DataTable components support Remoting in the
form of XML serialization. Rather than doing expensive
Marshalling, it uses XML and sent data across boundaries.
5. Firewalls and DCOM and Remoting: Those who have worked
with DCOM know that how difficult it is to marshal a DCOM
component across a router. People generally came up with
workarounds to solve this issue. ADO.NET DataSet uses
Remoting, through which a DataSet / DataTable component can
be serialized into XML, sent across the wire to a new
AppDomain, and then Desterilized back to a fully functional
DataSet. As the DataSet is completely disconnected, and it
has no dependency, we lose absolutely nothing by serializing
and transferring it through Remoting.

0
Preeti
Re: Difference between DataReader and DataAdapter / DataSet and

DataAdapter? Answer
#2
When accessing data the DataReader is the hands down winner.
Performance increases almost exponentially over the DataSet
when more than a few queries are executed sequentially.
Simple, fast forward, read-only access to result sets is the
DataReader's favorite pastime. If data doesn't need to be
modified, cached or serialized consider using a reader.
Don't dismiss the DataReader just because you need results
in XML. Try using the ExecuteXmlReader method of the
SqlCommand class. Just don't forget the FOR XML clause in
your query.
Business applications with a strong BLL that coerce
requested data into new types can use a DataReader without
fear of lost scalability. Often times the application's
business objects can easily duplicate or enhance some of the
functionality that the DataSet is so popular for. Creating
those business objects can mean the difference between an
application that entirely relies on DataSets to one that can
leverage their usefulness only where need be.
Binding of read-only data is much more efficient using a
reader. Just imagine how many times a day that DropDownList
you use is populated. Remember how much things cost in the
long run.

You might also like