Last post Mar 24, 2010 07:44 AM by kamanashish
Mar 22, 2010 09:37 AM|kamanashish|LINK
The Dumps data are in the Excel file. Now I want o upload the data to sql server 2005(which are in web server) from client pc (from browser). What will be the best way to do so?
I can know how to upload data from excel to sql server 2005 if both are in the same computer.
Thanks in advance.
Mar 22, 2010 10:44 AM|Sarahn|LINK
1) you can use the DTS ( comes with SQL server 2000 ) to import data from Excel into sQL server 2005. it does not give you the 2005 option by default, you will have to add it anyway and it will work.
2) You can write a small data import utility in .Net and connect to the excel application and process records one by one and then insert them into the sql server 2005 db.
if you are not comfortable working with excel directly, then you can import the data from excel into MS Access and query that.
hope that helps. good luck.
Mar 22, 2010 11:06 AM|atconway|LINK
I would use LINQ to query the Excel data from the client into DataSets, and then insert the data from the DataSets into the SQL2005 database. Take a look to the following form more information:
Getting data from Excel the fast way, using LINQ:
Using LINQ to Query Excel Tables:
Using Linq with Excel sheets:
If you are not familiar or don;t want to use LINQ, you could iterate through or BulkCopy the Excel records on the server and then insert them into SQL server as well; take a look below for more information:
C# and VB Project: A Tutorial Using Data Sets, Table Adapters, WebForms, Controls, File Upload, Excel Import:
Export Import Excel Data into Sql Server Using SqlBulkCopy-ASP.NET:
sql query to insert excel data into database table:
Mar 24, 2010 01:06 AM|kamanashish|LINK
Hello Sarahn, Hello atconway…
Thanks for your quick reply.
I have to work with data update within 2 wk. I will follow your instruction. When I will work with data upload I will post here for further discussion. Have a nice day.
Mar 24, 2010 07:24 AM|ravikanth192|LINK
check out this link it definitely help u in uploading the data
please quot Mark as Answer if Helped
Mar 24, 2010 07:44 AM|kamanashish|LINK
I think You did not read my question carefully, I have gone through your link.
My question was how can I upload data from excel. User just browse a excel file and click upload button , then all the data will be saved in the database . I don't want to save the excel file itself... just want to save the data in sql server 2005.