In LINQ to SQL, do you need to close the context after making a selection in the database (and, of course, after using the data)? if I leave it open, does this mean that the connection to the server remains open?
Thanks Lucian
A suitable connection is not closed or placed until you close the DataContext using the Dispose method. You should always call Dispose after using the DataContext. Think of the DataContext as a traditional Connection object, which is more or less what is under the hood.
Q. ?
. , . , ToList (TSource) . , , DataReader, LINQ to SQL.
:
, DataContext .
(, (MARS). . (MARS).
from MSDN LINQ to SQL
LiNQ. , , .
ASP.NET, , , - asp.net. open, , , Linq.
Windows Forms ( ), .
: , datacontext , , . , .
, . , .
Source: https://habr.com/ru/post/1703239/More articles:How do I make / apply a diff patch to this situation? - svnHow to compare mp3 programmatically - compareFree NHibernate + Lucene Search (NHibernate.Search) - nhibernateWriting a GUI for the BRCAPRO - rКомпилятор не создает templated ostream << оператор - c++Где рекомендуемое место для хранения экземпляров переменных для макетов - rubyInsert element in LINQ to SQL datacontext - not displayed until application restarts - asp.net-mvcStrange char * compilation error? - c ++Conceptual framework with long-term object context - .netIs there a Drupal module for importing text and images? - drupalAll Articles