In my excel file the 3th column is the type of DateTime, now I use :
DataTable myTable=excel.Worksheets["sheet1"].Cells.ExportDataTable(0,0,10,4);
to import data from excel to DataTable ,but when I use the codeline to get the data of 3th column, it didnot work:
DateTime a4=Convert.ToDateTime(myTable.Rows[3]);
How I can get the DateTime data from "myTable"?
1. If you want to get data of 3th column, you should
DateTime a4=Convert.ToDateTime(myTable.Rows[2]);
2. If you still cannot get the date time value, please send me your designer file and sample code, I will check it.