Below is the sample code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
DataTable dt = new DataTable(); dt = Comman.Select("USP_BackLogFilterResult", spar); var convertedList = (from rw in dt.AsEnumerable() select new SearchResultBackLogViewModel() { CompanyBacklogId = Convert.ToInt32(rw["CompanyBackLogId"]), BacklogId = Convert.ToInt64(rw["BackLogId"]), Details = Convert.ToString(rw["Details"]), RecentCommnet = Convert.ToString(rw["RecentCommnet"]), Title = Convert.ToString(rw["Title"]), TypeID = Convert.ToInt32(rw["TypeId"]), Type = Convert.ToString(rw["TypeName"]), PriorityID = Convert.ToInt32(rw["PriorityID"]), Priorityname = Convert.ToString(rw["PriorityName"]), StatusID = Convert.ToInt32(rw["StatusId"]), Statusname = Convert.ToString(rw["Statusname"]), SectionID = Convert.ToInt32(rw["SectionID"]), Sectionname = Convert.ToString(rw["Sectionname"]), Lastdate = Convert.ToDateTime(rw["Lastdate"]), LastActivitydate = Convert.ToString(rw["LastActivitydate"]), }).ToList(); |
Enjoy 🙂