Click here to Skip to main content
14,664,400 members
Rate this:
Please Sign up or sign in to vote.
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

Rate this:
Please Sign up or sign in to vote.

Solution 1

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[^].
   
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
Rate this:
Please Sign up or sign in to vote.

Solution 2

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.
   
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
Amir Mahfoozi 18-Dec-11 23:58pm
   
Thank you :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100