Click here to Skip to main content
15,884,986 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to assign list to datatable. the query result should display in datatable.
this is my query
C#
          IQueryable<tbl_holidays> holdaysQuery = from objsel in objLMS.tbl_Holidays
                                                    select objsel;
            IList<tbl_holidays>lstholidays = holdaysQuery.ToList();

            foreach (tbl_Holidays objhol in lstholidays)
            {


            }
this is my table
DataTable holidaysdt = new DataTable();

            holidaysdt.Columns.Add("ID", typeof(int));
            holidaysdt.Columns.Add("Holiday Id", typeof(int));
            holidaysdt.Columns.Add("Holiday Type", typeof(string));
            holidaysdt.Columns.Add("Holiday", typeof(string));
            holidaysdt.Columns.Add("Offilce Location", typeof(int));
            holidaysdt.Columns.Add("Date", typeof(DateTime));
            holidaysdt.Columns.Add("Remarks", typeof(string));
Posted
Updated 18-Oct-11 20:10pm
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900