Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Do you check connection on every call to SQL?
Message
 
 
To
11/03/2012 16:58:42
General information
Forum:
ASP.NET
Category:
Other
Environment versions
SQL Server:
SQL Server 2008
Miscellaneous
Thread ID:
01537347
Message ID:
01538010
Views:
24
>>Do you usually close the connection? And if yes, how? The last segment of your code shows that you call Fill() method to fill the dataset. But this, if I understand correctly, leaves the connection open. How do you deal with this?
>
>This should open and close the connection automatically. This is one reason Using/End Using was used. One advantage, as earlier mentioned, is that if something goes wrong in that code, it will be closed automatically as well as it is encapsulated in the Using/End Using. But, in this thread, I believe Viv mentioned something about the data adapter which might add additional variables to this context.

Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform