Click here to Skip to main content
15,884,592 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
how to read excel files in C# and store the data into sql server database table?
sequence of database table columns and excel columns is different.
Posted
Comments
Maciej Los 12-Nov-14 13:03pm    
What have you tried? Where are you stuck?

1 solution

See my past answer: import excel to db with file path[^]. There i suggested to use SqlBulkCopy class[^], which enables columns mapping.

Please, see: SqlBulkCopy.ColumnMappings Property[^]
SqlBulkCopyColumnMappingCollection Class[^]
 
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