Fetch Data using LINQ in Sharepoint
SPList List = web.Lists["abc"];
var checkin = from SPListItem p in List.Items
//&& p["col1"].ToString().ToLower() ==facility
where p["col2"].ToString().ToLower() ==val1.ToLower() && p["Room"].ToString().ToLower() == room && Convert.ToDateTime(p["fromDate"].ToString()) >=dtIn && Convert.ToDateTime(p["FromDate"].ToString()) < dtOut
select p;
SPList List = web.Lists["abc"];
var checkin = from SPListItem p in List.Items
//&& p["col1"].ToString().ToLower() ==facility
where p["col2"].ToString().ToLower() ==val1.ToLower() && p["Room"].ToString().ToLower() == room && Convert.ToDateTime(p["fromDate"].ToString()) >=dtIn && Convert.ToDateTime(p["FromDate"].ToString()) < dtOut
select p;
No comments:
Post a Comment