Category - SqlBulkCopy
Results 1 - 5 of 9
Here Mudassar Ahmed Khan has explained with an example, how to import (insert) CSV file (Text File) data into Database using SqlBulkCopy in ASP.Net MVC Razor.
The uploaded CSV file (Text File) data will be read using File class and the read data will be inserted into SQL Server database using SqlBulkCopy.
SqlBulkCopy class as the name suggests does bulk insert from one source to another and hence all rows from the DataTable can be easily read and inserted using the SqlBulkCopy class.
Here Mudassar Ahmed Khan has explained with an example, how to Import (Insert) Excel file data into Database using SqlBulkCopy in ASP.Net MVC Razor.

The uploaded Excel file data will be read using OLEDB library and the read data will be inserted into SQL Server database using SqlBulkCopy.

SqlBulkCopy class as the name suggests does bulk insert from one source to another and hence all rows from the Excel sheet can be easily read and inserted using the SqlBulkCopy class.
Here Mudassar Ahmed Khan has explained with an example, how to solve the following error (exception) that occurs in the WriteToServer function when SqlBulkCopy is used along with SqlTransaction class.
System.InvalidOperationException: Unexpected existing transaction.
Here Mudassar Ahmed Khan has explained with an example, how to use SqlBulkCopy to insert bulk data to database with Transaction i.e. Commit and Rollback feature in ASP.Net using C# and VB.Net.
SqlBulkCopy will be used along with the SqlTransaction class in order to perform Bulk Insert with Transaction i.e. Commit and Rollback feature in ASP.Net.
Here Mudassar Ahmed Khan has explained how to bulk copy data from DataTable (DataSet) to SQL Server database Table using SqlBulkCopy in C#, VB.Net and ASP.Net.
Results 1 - 5 of 9