c# - OleDb return Date Column value with time -
i have excel file(.xls) contain date column without time value. trying read file , put in datatable connection string below:
provider=microsoft.jet.oledb.4.0;data source=c:\users\test\desktop\1.xls; extended properties="excel 8.0;hdr=yes;imex=1;importmixedtypes=text"
excel file data
oledb return datem value time. 7/20/1995 12:00:00 am
datatable data
but want datem column value without time. have idea have solve problem.
thanks.
.net framework's datetime
consist of date , time. can't separate time
part datetime
, instead can use custom format displaying records.
string str = datetime.today.tostring("mm/dd/yyyy");
Comments
Post a Comment