Click here to Skip to main content
15,910,980 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I have to create a application like this.

I need to take excel file as input and store its data in sql db.

I am able to do this if i have fixed no of column coming from user in excel file. How to manage this if we get dynamic column from excel sheet.

Suppose 1st time we get excel file with id and name,
next time user send id , name , phone , address etc..


plzz suggest the way..
Posted
Comments
Er Daljeet Singh 19-Nov-13 1:56am    
for achieving this first try to read the column from the excel sheet.
then create a datatable with same number of column you are having in excel sheet.
after that alter your table in datable through code with schema as that of datatable .then with the sqlbulkcopy class insert data from datatable to database.
k@ran 20-Nov-13 4:23am    
thnxx for sharing your idea...
Maciej Los 19-Nov-13 17:29pm    
What have you tried? Where are you stuck?

1 solution

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