What are the two fundamental objects in ADO.NET ?
Answer:Fundamental Objects of ADO.Net are DataReader and DataSet . DataSet Object can have a set of DataTables, relationships between these tables. DataSet can be used in disconnected connection with DB. DataReader is used to read the read only data from a database.
What is difference between dataset and datareader ?
Answer:DataReader is used to fetch data from a database in a much faster way. Since the rows are fetched one at a time, load on the network will be low. Since DataReader is read only, transactions are not allowed . Since it is forward only, random data fetch is not supported.
DataSet is an in memory representation of a tables in a database. Dataset takes lot of application memory compared to DataReader. Its slower compared to DataReader. But user can do transactions using DataSet. It also support querying.
Answer:Connection Objects is used to establish a connection between an application and databases like Oracle, MySQl, SQL Server etc. Once connection is established, SQL Commands like insert, update, delete and select can be executed. Scope of a connection object can be local or global. If local connection object is used, it should be closed after SQL commands are executed.
Answer:They are used to connect a Connection object to a DataReader or DataSet. Following are the methods provided by a Command object:
Executes the command defined in the CommandText property against the connection defined in the Connection property for a query that does not return any row (an UPDATE, DELETE, or INSERT). Returns an Integer indicating the number of rows affected by the query.
Executes the command defined in the CommandText property against the connection defined in the Connection property. Returns a "reader" object that is connected to the resulting row set within the database, allowing the rows to be retrieved.
Executes the command defined in the CommandText property against the connection defined in the Connection property. Returns only a single value (effectively the first column of the first row of the resulting row set, any other returned columns and rows are discarded). It is fast and efficient when only a "singleton" value is required.
Answer:These objects connect one or more Command objects to a DataSet object. They provide logic that would get data from the data store and populates the tables in the DataSet, or pushes the changes in the DataSet back into the data store.
An OleDbDataAdapter object is used with an OLE-DB provider
A SqlDataAdapter object uses Tabular Data Services with MS SQL Server.
Answer:The DataSet provides the basis for disconnected storage and manipulation of relational data. We fill it from a data store, work with it while disconnected from that data store, then reconnect and flush changes back to the data store if required.
What are the various objects in a DataSet?
Answer:DataSet has a collection of DataTable objects within the Tables collection. Each DataTable object contains a collection of DataRow objects and a collection of DataColumn objects. There are also collections for primary keys, constraints, and default values used in this table, which is called as constraint collection, and the parent and child relationships between the tables. Finally, there is a DefaultView object for each table. This is used to create a DataView object based on the table, so that the data can be searched, filtered, or otherwise manipulated while displaying the data.
You can help us to improve by giving your valuable suggestions at firstname.lastname@example.org
By using the service of this site, I agree that I will serve wholeheartedly
and will not indulge in any sort of activity that threats the integrity of the organisation I am working for / I work for.
I have a firm believe in the notion that knowledge should be open source and
helping the needy and deserving part of society will always be my motto.
Knowledge is the power, Dont miss any paper, Subscribe to us