Showing posts with label linq. Show all posts
Showing posts with label linq. Show all posts

Tuesday, May 19, 2015

LINQ: SqlDateTime overflow. Must be between ...

WHEN a NULL value to passed to a non null datetime field using LINQ datasource. If the field is autogenerated make sure to mark as autogenerated in LINQ DBML designer else pass the value using a parameter

Thursday, April 30, 2015

Tuesday, September 16, 2014

LINQ Lamda Syntax - Selecting multiple columns

use the new keyword
var parent = dc.Forms.Select(f => new { f.FormID, f.ModuleId })

Wednesday, May 7, 2014

Tuesday, April 22, 2014

LINQ Case statement within Count asp net c#

var statu = from x in dc.Attendance
            group x by 1 into g
            select new
            {
                ID = g.Key,
                Presents = g.Where(t => t.AttendanceStatus == "Present").Count(),
                Absents = g.Where(t => t.AttendanceStatus == "Absent").Count(),
                Leaves = g.Where(t => t.AttendanceStatus == "Leave").Count(),
            };