The problem I am facing is that the data adapter only scans the first row in each column to determine the data type. In my case, the first column βSKUβ is the numbers for the first 500 lines, then I have SKUs that are mixed numbers and letters. So, what ends, the rows in the SKU column remain empty, but I still get different information for each row in the column.
I believe this is the connection string that controls this, and it should work with my current settings, but it is not.
Connection string:
conn.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\Nick\Desktop\Pricing2.xlsx" + @";Extended Properties=""Excel 12.0 Xml;HDR=Yes;IMEX=1;ImportMixedTypes=Text;TypeGuessRows=0""";
ImportMixedTypes=Text;TypeGuessRows=0
There should be important keywords, look at 0 lines and just use text as value types for everything.
The "Bandaid" I put this on is to make the first row in the spreadsheet a mixture of letters and numbers and, in particular, leave that row in my query.
c # connection-string import-from-excel oledbconnection
The Muffin Man Dec 29 '10 at 3:12 2010-12-29 03:12
source share