Follow in Twitter & Facebook



Like in Facebook

Powered By Blogger Widgets

Free Download

FREE Tools



Tuesday, August 21, 2012

Ado.Net Data access using disconnected architure in Asp.Net

In this article we will dicuss about how we can acess Ado.Net data using disconnected architure. You can also check my last article on DataSet and DataReader in asp.net here.

We need to use DataAdapter to work with Ado.Net in disconnected enviroment.

string connectionString = "Your connection string goes here";

//If the connection string is in web.config file then we can write below:

string connectionString = ConfigurationSettings.AppSettings["ConnectionString"].ToString();

SqlConnection con = new SqlConnection(connectionString);

SqlDataAdapter da = new SqlDataAdapter("SELECT * From Customers",con);

DataSet ds = new DataSet();

da.Fill(ds,"Customers");

Gridview1.DataSource = ds;

Gridview1.DataBind();

If you want to convert the dataset to data table then we can assign like below:

DataTable dt = ds.Tables["Customers"];

You can also check some javascript and jQuery articles.




0 on: "Ado.Net Data access using disconnected architure in Asp.Net"