Data Access Objcet In ASP.NET
ADO.NET provides its objects, properties, and methods through the three namespaces described in Table 5-1. The System.Data.SqlClient, System.Data.OracleClient, and System.Data.OleDb namespaces listed in the table provide equivalent features for Microsoft SQL Server and other databases, respectively.
// (1) Create the DataBase connection.
SqlConnection Conn = new SqlConnection("server=(local);" +
"database=Employee;Trusted_Connection=yes");
// (2) Create a Data Adapter.
DA = new SqlDataAdapter("select * from Contacts",
Conn);
// (3) Create a Dataset.
DataSet ds = new DataSet();
// (4) Fill the data set.
DA.Fill(ds, "Employee");
// (5) Display Records in data grid using data binding.
DataGrid1.DataSource = ds.Tables["Employee"].DefaultView;
DataGrid1.DataBind();
For futher information, open "http://dotnetheavens.blogspot.com/"
Thanks
-Nimesh.
Reference: http://dotnetheavens.blogspot.com/
