C# Tutorial - Import data from Excel to SQL Server | FoxLearn

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Welcome to FoxLearn In this tutorial, I'll show you how to import data from excel file to sql server Open your form designer, then drag TextBox, Button, Label, Combobox and DataGridView from the visual studio toolbox to your winform Next, We will design a simple UI that allows you to select the excel file, then load data from the excel file to DataGridView based on the sheet name you selected from the Comboxbox Right-click on your project, then select Manage Nuget Packages Next, You need to install the ExcelDataReader library to your project This is a lightweight and fast library written in c# for reading Microsoft Excel files You need to add the click event handler to the Browse button allows you to select the excel file, then open and read all sheet data You can use the CreateReader method of the ExcelReaderFactory class to read the excel file Data that you read from excel file will be returned as DataSet Next, you need to read all table names in the DataSet, then add the table name to the Combobox You need to specify the table name you want to retrieve the data, then bind the data to the DataGridView You need to install Dapper Plus from the Manage Nuget Packages to your project Dapper Plus is a high efficient Bulk Actions (Insert, Update, Delete, and Merge) for .NET It supports SQL Server, SQL Azure, SQL Compact, MySQL and more To play the demo, you should create a new database, then copy the customer table from the Northwind database into your database We will create a customer class with properties that correspond to the data fields in the customer table It allows you to map between customer objects and customer tables You need to add a BindingSource to your DataGridView, then modify your code to allow you to map data between DataTable and Customer List. You can use the BulkInsert method to insert large amounts of data into sql server Thank you for watching this video and don't forget to subscribe to my channel
Info
Channel: Fox Learn
Views: 50,638
Rating: undefined out of 5
Keywords: c#, .net, foxlearn, c# read excel file, c# open excel file, c# open excel worksheet, c# import excel to sql server, c# import data from excel to datagridview, c# import data from excel to sql server, c# winforms, import data from excel to sql server using c# windows application, bulk insert in sql server c#, c# import data from excel to sql, import data from excel to sql server using c#, c# read excel file into datatable, c# read excel file to datatable, how to read excel file in c#
Id: FhYCUhaDEt4
Channel Id: undefined
Length: 21min 40sec (1300 seconds)
Published: Tue Sep 03 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.