Click here to Skip to main content
15,889,595 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I want to insert and Update data from Excel to database using Asp .Net.
I have table which has column as
[Company_id] [int] 
[Name] 
[City] 
[Address] 
[Designation]

Now I want to create asp .net application to insert bulk data from excel file to database file and if company Id exist in database then It should update that company
data using stored procedure.

What I have tried:

I dont hav any Idea about this so please any one can provide code for this
Posted
Updated 9-Aug-17 2:02am
Comments
F-ES Sitecore 7-Aug-17 10:55am    
Better start writing some code then. Google "asp.net import excel to database" and you'll probably find some code to get you started.
[no name] 9-Aug-17 5:33am    
See the following link, how to read excel file,
http://csharp.net-informations.com/excel/csharp-read-excel.htm
once you fetch data from excel, pas it to database by making connection with DBMS and selecting database plus table, where you want to insert

1 solution

.NET has the ability to use various sources as data source, including ,text files, CSV, and Excel...
So probably the best way is to open the Excel file as data source (Excel connection strings - ConnectionStrings.com[^]) and save it to SQL as such...
 
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