You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Fast way to insert and update a very large list of rows in My SQL using C#
Problem is that large list of data are insert and update operations in My SQL are very slow if you use SqlCommand in the one by one per data.
Purpose
The purpose of this library is for performing Bulk Inserts and Updates without multiple insert and update statements for a collection of strongly typed queries.
//BulkToMySQL(DataTable dt, string tableName, string ConnectionString)/* -------------------------key note---------------------------- * * dt = datatable with values to be updated. * tableName = Table name to be updated in Database. * ConnectionString = MySql Connection String * * */boolresult=BulkInsert.BulkToMySQL(table,"test_bulk",connectionString);if(result)MessageBox.Show("Data Insert Successfully");
Bulk Update
//UpdateBulkToMySQL(DataTable dt, string tableName, string valueColumn, string conditionColumn, string ConnectionString)/* -------------------------key note---------------------------- * * dt = datatable with values to be updated. * tableName = Table name to be updated in Database. * Value_Column = column name to be updated. * conditionColumn = column name used to write 'WHERE' condition * ConnectionString= MySQL connection string * */boolresult=BulkUpdate.UpdateBulkToMySQL(table,"test_bulk","Name","ID",connectionString);
Dependencies
MySql.Data.dll
Contribute
The best way to contribute is by spreading the word about the library: