Help! SqlHelper.FillDataset & connections question

G

Guest

Has anyone seen this error? I'll try to explain in English because the code
sample would be too big, but I can attach code if necessary...

In my SaveButton_onClick event, I retrieve values off of my asp.net page,
then I call a stored procedure to save the values. This process always works
great the first time. On subsequent clicks of the same button (sometimes I
change the data, but sometimes it's the same), I will get an exception thrown
that includes the text: "Additional Information: A connection pooling error
has occurred".

In my aspx.vb on_click event, I create a Transaction that's passed into the
SqlHelper.ExecuteScalar function to call the proc. After the data has been
saved, I do myTransaction.Transaction.Commit(), then myTransaction = Nothing.
I've tried myTransaction.Transaction.dispose(), and a number of other
combinations.

I cannot figure out what line causes the error. I have set right before
everything that works with the connection, and sometimes I get this exception
thrown right when I click the button, as if it's having a problem on the
postback.

I'm also using quite a number of Datasets to populate my page in the first
place. Using the MS Application Block for data access, I use
SqlHelper.FillDataset to populate each of 10 datasets on the page. SqlHelper
has a bunch of overloaded FillDataset methods, but we're using one of the
ones that just passes in a connection string (rather than an actual
connection). Do you know if SqlHelper.FillDataset closes the database
connection before it returns to the caller? I cannot decide whether I should
just be passing in the same connection (pre-opened) to the FillDataset
method, or if passing in the conx string is better/worse. I'm convinced that
somehow I've got too many database conx open, but I don't know exactly how.

Other info: I know my conx string is consistent because it's hidden in a
class, that uses the same conx string no matter what database function I'm
calling.

This is preventing me from testing locally, so any help is greatly
appreciated!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top