Click here to Skip to main content
15,916,030 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends,

i have a problem of copying data from excel sheet to sql database
my excel sheet columns are Question No,Questions, Options1,Options2,Options3,Options4....

Help me...
Posted

1 solution

Hi,

You can do that on several ways.
In general:
1. Create table in sql db that have definition like your sheet.
2. Make OLDB connection and query excel data and
3. Use SqlBulkCopy class or SqlCommand to insert data int table.

Here are some examples:
1. http://www.aspdotnet-suresh.com/2010/09/import-data-from-excel-to-sql-database.html[^]
2. http://www.csharpaspnetarticles.com/2009/04/export-excel-data-sqlbulkcopy-aspnet.html[^]
3. Import Data from excel to SQL server using C# in ASP. NET[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900