Dot Net 5
Dot Net 5
1.ADO.NET
• The .NET Framework includes its own data access technology i.e.
ADO.NET
• ADO.NET is a set of classes that expose data access services for .NET
Framework programmers
• It is an integral part of the NET Framework
• ADO.NET provides a rich set of components for creating distributed and
data-sharing applications
• It provides access to relational, XML, and application data.
• ADO.NET is the latest implementation of (MDUA) Microsoft's Universal
Data Access strategy
2. Connection Object
• The Connection object is the first component of ADO.NET
• A Connection object sits between a data source and a DataAdapter (via
Command)
• You need to define a data provider and a data source when you create a
connection
• The Connection Object is a part of ADO.NET Data Provider and it is a
unique session with the Data Source
• In .Net Framework the Connection Object is Handling the part of
physical communication between the application and the Data Source. (
• ADO.NET Connection Object connects to the specified Database and
open a connection between the application and the Database.
• When the connection is established, SQL Commands may be executed,
with the help of the Connection Object to retrieve or manipulate data in
the Database.
• Once the Database activity is over, Connection should be closed and
releases the resources.
3.Command object
• The Command Object in ADO.NET executes SQL statements and Stored
Procedures against the data source specified in the Connection Object
• The Command Object required an instance of a Connection Object for
executing the SQL statements.
• The Command Object has a property called CommandText, which
contains a String value that represents the command that will be
executed in the Data Source.
• When the CommandType property is set to Stored Procedure, the
CommandText property should be set to the name of the stored
procedure.
4. methods uses in the Command Object to execute the SQL statements.
1. ExecuteNonQuery
2. ExecuteReader
3. ExecuteScalar
5.ADO.NET DataSet
• It is a collection of data tables that contain the data.
• it is used to fetch data without interacting with a Data Source that's why,
it also known as disconnected data access method.
• It is an in-memory data store that can hold more than one table at the
same time
• The DataSet can also be used to read and write data as XML document.
• ADO.NET provides a DataSet class that can be used to create DataSet
object
• It contains constructors and methods to perform data related operations
6.ADO.NET DataTable
• ADO.NET DataTable objects are used to represent the tables in a
DataSet.
• A DataTable represents one table of in-memory relational data
• The DataTable class is a member of the System.
• You can create and use a DataTable independently or as a member of a
DataSet
• DataTable objects can also be used in conjunction with other
• You access the collection of tables in a DataSet through the Tables
property of the DataSet object
• a table is represented by columns and constraints.
• a DataTable must also have rows to contain and order data.
• The DataRow class represents the actual data contained in a table
• You use the DataRow and its properties and methods to retrieve,
evaluate, and manipulate the data in a table.
• You create a relationship between DataTable objects using a Data
Relation.