TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
dc
NA
663
0
linq to sql question
Feb 7 2013 5:02 PM
In a C# 2008 application, I am using linq to sql statements that look like the following:
Case 1:
using (RPTDataContext rptData = new RPTDataContext())
{
var RPTupdate = (from a in rptData.Trackings
where a.Package_ID == pkgId
select a).SingleOrDefault();
}
Case 2:
TDataContext TData = new TDataContext();
var TNumber = (from dw in cms_TData.people
where dw.Organization_Name.ToUpper().Trim() == strOrgnizationName.Trim()
I am asking that question since an application I am working on is having a memory leak. I am trying to
rule out the above statements as the reason for the memory leak.
My question is could either of this statements cause a memory leak, leave a database connection open,
keep the database object 'alive' in memory? If so, can you tell me what statement could cause that kind of
problem and how to write the code so the problem does not persist?
Reply
Answers (
1
)
linq statements verify
C# linq to sql connections