Well all know dataSet works in disconnected architecture . So internally it opens connection & closes right .. so i want to know when it will open & close connection i tried like below ??
OleDbConnection con = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\users\\sunil\\my documents\\empdatabase.accdb;Persist Security Info=False");
OleDbDataAdapter da = new OleDbDataAdapter("Select * from customer ", con);
DataSet ds = new DataSet();
da.Fill(ds,"sunil");
dataGridView1.DataSource = ds.Tables[0];
I kept messagebox.show(con.state.Tostring()); one every line to know when it is open but i am getting always its is closed ..
Any suggestions
Cheers & thanks

Iftikar HussainPosted Sep 18, 2013, 5:44 AM
I think you have misunderstood about DataSet. It is a disconnected object, that does not mean you can fill the dataset without opening your connection. DataSet mainly used when you want to reterive large number of records from DataBase then you have to use for DataSet. Once you fill the dataset then you can close the connection. After that using the dataset you can manipulate the value.
Regards,
Iftikar
SUNIL GUTTAPosted Sep 18, 2013, 6:05 AM
TY Pankaj Kumar :)
Have a nice day
Pankaj KumarPosted Sep 18, 2013, 5:48 AM
when u call the fill() .it will open the connection and fill the dataset and close the connection.
and no need to write open() and close() connection