Abhilash J A

Abhilash J A

  • 531
  • 2.4k
  • 598.3k

error-String was not recognized as a valid DateTime.

Jan 16 2017 9:42 AM
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)