Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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.

Along with the CP article posted above check this one too:
Inserting Excel File Records Into SQL Server Database Using ASP.Net C#[^]
 
Share this answer
 
 
Share this answer
 
Hi there,

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

Here is the Link

I hope this helps you.
 
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