For reading a delimited file into a dataset such as a CSV file you can use the TextFieldParser (example of its use is in the help file). There is also many other options for reading the file and splitting up its fields to assign to rows in a dataset.
You can then either set up stored procedures for your insert commands and assign its source to your dataset or use sqlBulkCopy to write the dataset contents to your database. Transactions can be used in both of the above choices to roll back all of the records if for any reason some record fails to fully be inserted.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.