Reading .CSV File And Inserting Data to SQL Table using SqlBulkCopy

Introduction

This trick is a complete solution to the programmers who want a solution to read CSV file using Open file dialog, store the raw data in a Data Grid View control and lastly insert the raw data in a SQL table using SQLbulkcopy.

Using the Code

First u need to create a Database with a table named Company for example. The table creation SQL script is provided below.