Hi friends !! This is Priya here......First of all ..How are you all ?Hope that you all are fine..
I am sharing a tutorial with you that is completely useful for .NET developers as I was trying to import the excel sheet data in the database i.e. SQL server 2008 and after a lot of effort , I became successful in doing this task.This tutorial help you how to import excel sheet data into sql server 2008 using c#.
Here are the code for this :
You have to follow some steps and then you'll be able to do this successfully . Just follow each and every step carefully :
Before doing this, your system must have following application software :
A) Visual Studio 2008 or later version(Here I am using VS 12) and framework must be 3.5 or later version.
B)SQL Server 2005 or later version
C)MS Office 2007 or later version
D) Any Browser
Suppose you have to insert a question bank data (which is in excel sheet) in the database . This excel sheet looks like this :
You have to import this excel sheet data into the database . Just follow the below steps :
1)Open Visual Studio 2008 or later version.
Go to File--->New Website----> Choose Empty website----->give a name to your website----> OK.
2)Open the source code and just add the following code in the same.
3) This source code will look like this in the front end:
4) Now you have to add this C# code on the click event of link button("insert data") :
C# code :
after this, add the following code just below this code ::
And then save the website and debug it and then run it ; you'll be able to transfer your excel data in the database .
Thank you guys!! Keep on visiting www.TricksWay.com..
We'll provide you more and more tutorials for you ....
For any queries, you can contact at firstname.lastname@example.org
Originally Shared by Guest Author : Priya.