c# - OLEDB extract Excel date format cell but result in incorrect outcome -


i trying extract data in excel while got unexpected result.

i publishing project in iis7.5 , use ace engine extract excel information, connection string:

    connstring = "provider=microsoft.ace.oledb.12.0;data source=" + strnewpath + ";extended properties=\"excel 12.0 xml;hdr=no;imex=1\"" 

my excel has date fields below:

excel image

when use below code extract data:

    query = "select * [roster$]";      cmd = new oledbcommand(query, conn);      da = new oledbdataadapter(cmd);      da.fill(ds);      showmessage(ds.tables[0].rows[10][0].tostring()); 

i got interesting result below:

    1-¤q¤@¤ë 

while expecting this:

    1-nov 

do have idea on happening engine? tried kind of browsers got negative result. meanwhile, gives want if not publish iis, access through debug mode in visual studio.

will thank helping me!

use connstring,

connstring = "provider=microsoft.ace.oledb.12.0;data source=" + strnewpath + ";extended properties=\"excel 12.0;hdr=yes;imex=1;\"" 

working fine....


Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -