Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Aug 12, 2012 12:53 AM by Paul Linton
Aug 11, 2012 11:32 PM|LINK
Do I need to open and close a Sqlconnection, when I use dataset? I works fine out.
public DataSet SelectRows(DataSet dataset, SqlConnection connectionString, string queryString)
SqlDataAdapter adapter = new SqlDataAdapter();
adapter.SelectCommand = new SqlCommand(queryString, connectionString);
Normally I would close the Sqlconnection. But is it necessary here?
Aug 11, 2012 11:47 PM|LINK
No the data adapter will open and close the connection for you
Aug 12, 2012 12:53 AM|LINK
the data adapter will open and close the connection for you