Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear all,

I want to save the data from excel to the database and export data from datagrid to excel. Please help me out

Thanks and regards,
mvengaqu
Posted
Comments
mvengaqua 18-Dec-11 11:54am    
IN VB.NET

To read data from excel, this[^] article could be useful to you.

To export data, you can go through Export to Excel using VB.Net[^].
 
Share this answer
 
Comments
mvengaqua 18-Dec-11 12:03pm    
thanks abhinav
Abhinav S 18-Dec-11 12:06pm    
You are welcome.
Sergey Alexandrovich Kryukov 18-Dec-11 12:40pm    
My 5.
--SA
Abhinav S 18-Dec-11 12:42pm    
Thank you SA.
mvengaqua 19-Dec-11 3:20am    
i want to do this in vb.net and not in asp.net. Please tell me for vb.net
For importing data from an excel fine the OPENROWSET command will help you :
http://support.microsoft.com/kb/321686[^]

http://jasonhaley.com/blog/post/2004/03/06/OPENROWSET-T-SQL-function.aspx[^]

www.sqlservercentral.com/Forums/Topic496226-148-1.aspx[^]

Of course datagrids don't have data by their own and they are linked to a datasource that you should work with them. so to dump data in a datasource into an excel spreadsheet read these pages :
http://www.dotnetperls.com/excel-vbnet[^]

http://stackoverflow.com/questions/3096090/fastest-way-to-write-cells-to-excel-with-office-interop[^]

Hope it helps.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 18-Dec-11 12:41pm    
Should be useful, my 5.
--SA
Amir Mahfoozi 18-Dec-11 23:57pm    
Thank you :)
Abhinav S 18-Dec-11 12:42pm    
Good links.5.
Amir Mahfoozi 18-Dec-11 23:58pm    
Thank you :)
Wendelius 18-Dec-11 13:26pm    
Good answer, 5'd

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