I am reading an excel file to a datatable using oledb.
OleDbCommand cmdSelect = new OleDbCommand(@"SELECT * FROM [Price Table$] ", cnCSV);
I got data binded to the datatable.
In my excel sheet, The Dropdownlist cells were there for few columns. It was dragged to nearly 500 rows.
This is the problem: After reading excel, in my datatable i am having no. of rows were 500. But actually the excel sheet contains values only upto 10 rows.
But when i try to insert, 500 rows were created in the database table.
I should take those 10 rows only and insert into the database table.
Checking string.empty will not solve this problem, coz I am inserting some data apart from the excel too.
I couldnt able to resolve this problem. Can anybody help me in this regard.