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
Jayanth Reddy
NA
250
9.8k
Retreiving Data
Aug 13 2019 2:32 AM
I am trying to retreive the Max value of Id from the sql server using "Linq to sql" to display in the form, but getting 0 as the value.Instead of Max, if i use a Count() it is giving the exact count value.Can anyone help me how to get the max value of a column using linq to sql query.
CompanyDataContext dc = new CompanyDataContext();
Employee obj = new Employee();
var c = ((from Employee in dc.Employees select obj.id).Max());
label6.Text=(c+1).ToString();
Reply
Answers (
2
)
Return huge text file or byte array thru web API
EnterpriseLibrary.Logging.NetCore