c# - Oledb Read False Value From Excel Sheet -
i trying read excel sheet already opened in window explorer using oledbreader following code
system.data.oledb.oledbconnection mcon; mcon.connectionstring = ("provider=microsoft.ace.oledb.12.0;data source=" + openfiledialog1.filename + ";extended properties=\"excel 12.0;hdr=no;imex=1\";"); strselectquery = "select top 20 * [$sheet1]"; if (mcon.state == connectionstate.closed) { mcon.open(); } dataadapter = new system.data.oledb.oledbdataadapter(strselectquery, mcon); dataadapter.fill(mdtable); dataadapter.dispose(); mcon.close();
here reads
03-aug-12 41124 // excel column has genral format 07:29:19 0.31202546296 //excel column has genral format 359307046362750 3.5930704636e+014 // excel column has number format decimal place 0
if excel file closed reads value in correct format. why doing ?
Comments
Post a Comment