At least few things to notice
When you loop through the rows from Excel, you set a new data table and a new dataview on each iteration when the amount is less than what is found in the database. This causes the situation where only the last row remains.
You should use a single data table and in the loop, just insert the desired rows to this table. After the loop use the data table for binding etc
Another thing is, when you query the database yo concatenate the values directly into the SQL statement. This leaves you open to SQL injections and introduces possible conversion problems. For more info, see
SQL injection - Wikipedia[
^]
The proper way would be to use
SqlParameter Class (System.Data.SqlClient)[
^]