furyfish
furyfish

Reputation: 2135

Import data from excel to sql server C# Application

I'm using sql server 2008. I have a database "CustomerManagement", and a table "Customer" like this:

CustomerID    |    Name    |    Money
1             | Paul       | 300
2             | Mary       | 250
3             | David      | 
4             | May        | 
5             | Ann        | 

And I have an excel file, with some data as the following:

CustomerID    |    Money
3             | 100
4             | 150
5             | 175

How I can insert "Money" in excel file to sql server based on CustomerID?

I'm using winform C# and MS Excel 2010

Upvotes: 0

Views: 6587

Answers (1)

andy
andy

Reputation: 6079

Retrieve all the data from Excel which you want to insert to sql Database and then loop it and insert to sql server.

Retrieve Data

Insert to SQL Database

Upvotes: 1

Related Questions