First of all, why do you use
IMEX=1
? This causes Excel to treat all data as a text.
For further details, please read this:
Treating data as text - Microsoft.ACE.OLEDB.12.0 - ConnectionStrings.com[
^]
Second of all, why do you try to get some portion of data, instead of all (at once)? And... Are you sure that sheet name or named range is written properly?
string str = "select Top " + previewrow + " * from [" + cmb1string + "]";
Take a look at examples:
SELECT [Column Name One], [Column Name Two] FROM [Sheet One$]
As you can see, excel worksheet name is followed by a "$" and wrapped in "[" "]" brackets.
If you want to start reading data from cell A3 to D5000, use:
SELECT * FROM [Sheet1$A3:D5000]
Finally, i'd suggest to write
DAL[
^]. This object should help you to create connection, process
CRUD[
^] operations and close connection.