5
Reply

error-String was not recognized as a valid DateTime.

Mani Kandan

Mani Kandan

Jan 16 2017 9:42 AM
258
Hello everyone,
 
I am getting list of data from datatable with date also. 
  1. List<Tble_accessLog> objTble_accessLog = new List<Tble_accessLog>();  
  2.                if (dt != null && dt.Rows.Count > 0)  
  3.                {  
  4.                    objTble_accessLog = dt.AsEnumerable().Select(m => new Tble_accessLog()  
  5.                    {  
  6.                        accessLogId = m.Field<Int64>("accessLogId"),  
  7.                        FullName = m.Field<string>("FullName"),  
  8.                        AccessDate = m.Field<string>("AccessDate"),  
  9.                        Action = m.Field<string>("Action")  
  10.                    }).ToList();  
  11.                    cnn.Close();  
  12.                }  
  13.                return objTble_accessLog;  
After I am trying to bind this data to listview, then occurred date format error. Here  AccessDate string datatype. 
 
 
How can I solve this issue? Please help me. 

Answers (5)