Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Already opened DataReader
Message
From
12/03/2011 02:06:33
 
 
To
11/03/2011 21:02:09
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01503339
Message ID:
01503452
Views:
33
>Michel, a DataSet is not dependent on it's database connection. The DataSet doesn't need to know anything about where it's data comes from, unless you've specifically put code into your framework that somehow ties the two together. If so, this is not a good idea. Viv is correct about closing the connections. You should open, fill your DataSet, close & pass your DataSet around after that. Same with updating ... open, set up your update parameters, update, then close again.
>
>And actually, you don't even need to specifically open your connection when filling a DataSet with DataAdapter.Fill() because the DataAdapter will automatically take care of the open/close for you. Open if it isn't already open & close it if it wasn't previously open.

Thanks, as far as where the DataAdapter.Fill() is, it is in the SQLExec() method and is done at the framework level. Thus, when the client execute that method, the DataSet becomes available. So, at the time this command is done, the connection is still opened. So, I don't think I have something to change in there but to close it before leaving the method. I tried that in the first place in an early version today but my changes were not final. So, this is probably why it didn't work. Now, that I have adjusted the InitializeObject() method, closing it after each of those framework data methods, should do it.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform