Dinesh Santhalingam

Dinesh Santhalingam

  • NA
  • 737
  • 368.5k

Affect the data table

Jan 3 2017 8:28 AM
I have a data table .I load it from sql .The table containing three columns .Now i want to make some change in the table.(ex)I want to change a column date time(mm/dd/yy)to dd/mm/yy format.
 
  1.   private void  chartload()  
  2. {  
  3. datatable dt=new datatable();  
  4. //Table have some data.  
  5. List<eDetails> elist = new List<licenseDetails>();  
  6.       elist = (from DataRow dr in dt.Rows  
  7.    select new licenseDetails()  
  8.                {  
  9.          Name = dr["Name"].ToString(),  
  10.            Objdr["obj"].ToString(),  
  11.                                 Time=Convert.ToDateTime(dr["Time"]).ToString("dd/mm/yy H:mm")  
  12.                                            }).ToList();  
  13. //I affect the date format   
  14. //I want to load my list to data table  
  15.   
  16. }  
  17.   
  18.  public class eDetails  
  19.         {  
  20.             public string Name { get; set; }  
  21.             public string Inuse { get; set; }  
  22.             public string Time { get; set; }  
  23.         }  
 I want to load my list to data table .Suggest some ideas.

Answers (9)