problem with SQL server 2000 connection in C#.net

  • Thread starter Thread starter Ananta
  • Start date Start date
A

Ananta

Hi

I am having a problem with the SQL server connected in VC#.net

I am using the SQLDataAdaptors to access and fill the data to the
DataSets.

There are certain pages in sequence which run one after the another as
a process based on the user interaction. All the pages (even pages
before entering this process) have the data connection to the SQL
server 2000. On some of the specific pages the data connection is
close. If catch the error and open the connection the catch block i
am able to open the connection there. So, does not seem like to be a
problem with the pooling.

I am not sure where the problem is.

Can anyone help?
 
All the pages (even pages
before entering this process) have the data connection to the SQL
server 2000.

Do you mean you reuse a connection accross pages ? Also a DataReader may
automatically close a connection depending on its option.

The usual scheme is to create, open, use, close, dispose the connection one
each page...
 
No i am actually using the data adpators. Data Adaptors automatically
open and close the connection as and when needed. This is where it is
going wrong. Data Adaptor when it tried to fetch the data the
connection is closed. But when i trap the exception and open the
connection manuall, i am able to open it fine. That means the pool
limit is not reached.
 
Back
Top