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
C# linq to sql issue
Oct 4 2012 11:44 PM
In a C# 2010 app, I am trying to write a linq to sql statement that is having a problem. The error message says the value is not an instance of an object.
The sql similar is the following:
select COUNT (Trans_id),ip.TNum, from dbo.Trans t inner join dbo.IWbook iw on t.IWork_ID = iw.IWork_ID inner join dbo.IPack ip on ip.PID = iw.PID where ip.TNum = @parameter_value group by ip.TNum
The linq is the following:
var varGoodTransCount = (from t in rData.Trans join iw in rData.Ibooks on t.Ibook_ID equals iw.Ibook_ID join ip in rData.IPacks on iw.PID equals ip.PID where ip.TNum == SPkgID group ip by ip.TNum into g select new { TNum = g.Key, Frequency = g.Count() }).FirstOrDefault();
I am checking for if (varGoodTransCount.frequency != null) when the error is occuring.
Thus can you tell me what could be wrong?
Reply
Answers (
1
)
C# linq count
picture size