Click here to Skip to main content
15,791,739 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
Hai All,
I am developing one VB Application in Visual Studio 2010. And readings the records from Access Table via Data Grid View. Now i need to export that records from access table to excel sheet That to how many records user wanted only that records has been export to excel sheet.
Here i am giving the code that i am using to display the records from data grid view

cnnOLEDB.ConnectionString = strConnectionString
        'Timer1.Enabled = True
        Dim dt1 As New DataTable()
        Dim adp As New OleDb.OleDbDataAdapter("SELECT TOP 10 * FROM SMSDATA1DB ORDER BY Date_Time DESC", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & System.Environment.CurrentDirectory & "\SMSDB.mdb")
        DGView.DataSource = dt1

Any body please help to export records to excel sheet PLZZZZZZZZZZZ................
coded007 5-Dec-11 21:56pm    
can you tell me exactly user need to select each record and export or directly he can export number of records
Himachandra 6-Dec-11 0:16am    
Directly export No.of records.......

Share this answer
Export to Excel using VB.Net[^]

This link will be very helpful to you....:)
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