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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Shivanand ArurRank #920 · 2.3K reputationPosted Sep 26, 2012, 2:51 AM EDT
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
Satyapriya NayakRank #47 · 31.5K reputationPosted Sep 26, 2012, 3:10 AM EDT
Shivanand ArurRank #920 · 2.3K reputationPosted Sep 30, 2012, 1:40 AM EDT
SqlDataAdapter da1 = new SqlDataAdapter("Select * from CollegeMembers", con);
con.Close();