How to get the data from the column of DataTable which is the type of DateTime?


#1

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.RowsIdea[3]);

How I can get the DateTime data from "myTable"?


#2

1. If you want to get data of 3th column, you should
DateTime a4=Convert.ToDateTime(myTable.RowsIdea[2]);

2. If you still cannot get the date time value, please send me your designer file and sample code, I will check it.