Click here to Skip to main content
14,664,409 members
Rate this:
Please Sign up or sign in to vote.
I have a excel data like
pincode         city              state           country
 251010      hyderabad          telanagana           india
 524303      Nellore            AndhraPradesh        india
 25411       Banglore            Karnataka           india
  10110      Vegas                USaState            USA


by using c# code I want to store as shown in below

I want to store above excel file in database table like as shown in below format
dynamically using c# and linq

id  Parentid  Type         Text
 1    0        Country     India
 2    0        Country     USA
 3    1        State       AndhraPradesh
 4    2          State      USAState


how can is achieve this one please help me out
Posted
Updated 9-Jan-16 19:40pm
v5
Comments
Prasad Avunoori 30-Dec-15 8:48am
   
Hi Prasad,

Please elaborate your question.
ZurdoDev 30-Dec-15 9:25am
   
Use the import tools in SQL.

Rate this:
Please Sign up or sign in to vote.

Solution 3

Along with the CP article posted above check this one too:
Inserting Excel File Records Into SQL Server Database Using ASP.Net C#[^]
   
Rate this:
Please Sign up or sign in to vote.

Solution 1

Hi there,

There is a very detailed post about converting excel file to db files.

Here is the Link

I hope this helps you.
   

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100