{"id":19991345,"url":"https://github.com/ShalithaCell/MySQLBulk-Insert-Update","last_synced_at":"2025-05-04T10:31:29.413Z","repository":{"id":105984390,"uuid":"174062585","full_name":"ShalithaCell/MySQLBulk-Insert-Update","owner":"ShalithaCell","description":"Improve MySQL bulk data insert and update","archived":false,"fork":false,"pushed_at":"2019-03-09T04:36:45.000Z","size":236,"stargazers_count":7,"open_issues_count":0,"forks_count":4,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-23T00:28:31.556Z","etag":null,"topics":["bulk","bulk-data","csharp","mysql","mysql-insert","mysql-update"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ShalithaCell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-06T03:16:28.000Z","updated_at":"2023-08-15T18:34:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"878814da-1017-4a70-a8e1-1467fea78a68","html_url":"https://github.com/ShalithaCell/MySQLBulk-Insert-Update","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShalithaCell%2FMySQLBulk-Insert-Update","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShalithaCell%2FMySQLBulk-Insert-Update/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShalithaCell%2FMySQLBulk-Insert-Update/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShalithaCell%2FMySQLBulk-Insert-Update/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ShalithaCell","download_url":"https://codeload.github.com/ShalithaCell/MySQLBulk-Insert-Update/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252320258,"owners_count":21729097,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bulk","bulk-data","csharp","mysql","mysql-insert","mysql-update"],"created_at":"2024-11-13T04:51:43.081Z","updated_at":"2025-05-04T10:31:29.408Z","avatar_url":"https://github.com/ShalithaCell.png","language":"C#","funding_links":[],"categories":["C\\#"],"sub_categories":[],"readme":"# MySQL BulkInsert \u0026 BulkUpdate\nFast way to insert and update a very large list of rows in My SQL using C#\n\nProblem 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.\n\n\n---\n\n# Purpose\n\nThe purpose of this library is for performing Bulk Inserts and Updates without multiple insert and update statements for a collection of strongly typed queries.\n\n---\n\n# Usage\n\n### Generating Data table\n```C#\nDataTable table = new DataTable();\ntable.Columns.Add(\"ID\");\ntable.Columns.Add(\"Name\");\nfor(int i = 0; i \u003c 100; i++)\n{\n     table.Rows.Add((i+1).ToString(), RandomString(10));\n}\n```\n\n### Import lib\n\nAdd Reference to **MySQLBulkIU.dll** file\n\n```C#\nusing MySQLBulkIU;\n```\n\n### Create connection string\n\n```C#\nstring connectionString = \"Server=localhost;Database=test;Uid=root;Pwd=1234;\";\n```\n\n### Bulk Insert\n\n```C#\n\n//BulkToMySQL(DataTable dt, string tableName, string ConnectionString)\n/* -------------------------key note----------------------------\n             * \n             * dt               = datatable with values to be updated.\n             * tableName        = Table name to be updated in Database.\n             * ConnectionString = MySql Connection String\n             * \n             * */\nbool result = BulkInsert.BulkToMySQL(table, \"test_bulk\", connectionString);\n\nif (result)\n   MessageBox.Show(\"Data Insert Successfully\");\n```\n\n### Bulk Update\n\n```C#\n//UpdateBulkToMySQL(DataTable dt, string tableName, string valueColumn, string conditionColumn, string ConnectionString)\n/* -------------------------key note----------------------------\n             * \n             * dt              = datatable with values to be updated.\n             * tableName       = Table name to be updated in Database.\n             * Value_Column    = column name to be updated.\n             * conditionColumn = column name used to write 'WHERE' condition\n             * ConnectionString= MySQL connection string\n             * */\n\nbool result = BulkUpdate.UpdateBulkToMySQL(table, \"test_bulk\", \"Name\", \"ID\", connectionString);\n\n```\n\n---\n\n# Dependencies\n\n* MySql.Data.dll\n\n---\n\n# Contribute\n\nThe best way to contribute is by spreading the word about the library:\n\n* Blog it\n* Comment it\n* Fork it\n* Star it\n* Share it\n\nA **HUGE THANKS** for your help.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FShalithaCell%2FMySQLBulk-Insert-Update","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FShalithaCell%2FMySQLBulk-Insert-Update","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FShalithaCell%2FMySQLBulk-Insert-Update/lists"}