Connect two dataadapter to same data source using single connection at same time in Ado.Net
can i Connect two dataadapter to same data source using single connection at same time in Ado.Net and how?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Shivanand ArurPosted Sep 30, 2012, 5:40 AM
SqlDataAdapter da1 = new SqlDataAdapter("Select * from CollegeMembers", con);
con.Close();
Satyapriya NayakPosted Sep 26, 2012, 7:10 AM
Shivanand ArurPosted Sep 26, 2012, 6:51 AM
Basically a Adapter is nothing but a Bridge between the DataSource and the DataSet/DataTable. It get the information from the DataSource and helps to fill the Dataset or DataTable.... It is basically used in Disconnected Architecture...
protected void AdapterTest()
{
SqlConnection CON = new SqlConnection();
CON.ConnectionString = "Connection String";
SqlCommand cmd = new SqlCommand("Select * from tableName", CON);
CON.Open();
DataSet ds = new DataSet();
DataSet ds2 = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(cmd.CommandText, CON);
SqlDataAdapter da2 = new SqlDataAdapter(cmd.CommandText, CON);
CON.Close();
da.Fill(ds);
da2.Fill(ds2);
}
May be I am wrong with this solution, but you can still try and let me know.
PLEASE MARK THE ANSWER AS ACCEPTED IF IT HELPED YOU!!!
Thanks