0

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

furyfish
  • 2,055
  • 5
  • 26
  • 28
  • did you search SO or google? http://stackoverflow.com/questions/10750803/import-excel-file-into-microsoft-sql-server-using-c-sharp – Asken Nov 26 '12 at 08:10
  • @Asken: yes, i did. But it tutorials insert data from excel to a new table. What I want is insert data to table with specified ID – furyfish Nov 26 '12 at 08:15

1 Answers1

1

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

andy
  • 5,979
  • 2
  • 27
  • 49