DataAdapter

  • Thread starter Thread starter Stephen Noronha
  • Start date Start date
S

Stephen Noronha

I have a question, please correct me if I am wrong.

I am assuming that a dataadapter establishes a connection and after filling
the dataset or datatable or whatever, will close the connection to the DB
right???

If yes, is there any reason that the connection get disconnected/timeout
and how can i find out what happened?

Thanks,
Stephen
 
Search on "Lutz Reflector" and download his tool.
You can use it to view the .NET Framework source code.

Yes, if a connection has not been established on
the DataAdapter, it does create its own and closes
it upon completion.

I'd have to look at the .NET Framework source
code again to see if it throws an error.
 
Hi Robbe,
thanks for the reply. this post is wrt a problem i am facing with filling a
dataset using Dataadapter.

I have tested a stored procedure using Query Analyser, it works (it takes a
long time... but it does)
I use this SP in my app and fill up a dataset. I have not "Connection
timeout" parameter set but at "da.fill(ds)" in a matter of like a min, i get
a SQL Exception for a "Timeout", i am still not able to figure out where is
this timeout occuring?

any Sugesstions?
Thanks,
Stephen
 
This maybe the command timing out.

After you create the dataadapter, set the command timeout on the
SelectCommand. Alternatively, if you want full control over the connection
and the command, create the connection object first, set the timeout, open
the connection, create the command object, set the timeout on this also, set
the command text and then create the dataadapter using the command object in
the dataadapter constructor.

Landers
 
Back
Top