is there a way to insert values (many rows) from dataset to the dataBase?
thnaks in advanced.
Printable View
is there a way to insert values (many rows) from dataset to the dataBase?
thnaks in advanced.
There are several approaches you can take.
If you need to log for example any row that fails, you could use the DataAdapter's Update method call on the database. Keep in mind though that if you have a large amount of rows, this will be extremely slow since you will be executing a sql command for each row.
If you just want to do "all or none" import of data, look into SqlBulkCopy. Extremely fast and should be used if you have to import many rows.