K
Keith
Hi,
if have this method in a cs file that connections to a
database and returns a datareader to my web form.
public OleDbDataReader GetDataReader(string theSQL)
{
theConn = new OleDbConnection(ConnectionString);
theConn.Open();
OleDbCommand cmd = new OleDbCommand(theSQL, theConn);
OleDbDataReader theResult = cmd.ExecuteReader
(CommandBehavior.CloseConnection);
return theResult;
}
in the aspx file, after getting the result of this Query
method, i will close the datareader. Is this adequate? do
i need to close the OleDbConnection as well? if so, how
can i point to the OleDbConnection?
I realise that my database has got a series of open
connection which i suspect is caused by my web application.
thanks for any help
if have this method in a cs file that connections to a
database and returns a datareader to my web form.
public OleDbDataReader GetDataReader(string theSQL)
{
theConn = new OleDbConnection(ConnectionString);
theConn.Open();
OleDbCommand cmd = new OleDbCommand(theSQL, theConn);
OleDbDataReader theResult = cmd.ExecuteReader
(CommandBehavior.CloseConnection);
return theResult;
}
in the aspx file, after getting the result of this Query
method, i will close the datareader. Is this adequate? do
i need to close the OleDbConnection as well? if so, how
can i point to the OleDbConnection?
I realise that my database has got a series of open
connection which i suspect is caused by my web application.
thanks for any help