How to export data from SQL Server 2005 to Excel

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SEhtesham
    New Member
    • Aug 2011
    • 45

    How to export data from SQL Server 2005 to Excel

    Hi,
    My application is in VS2008 and coded in Vb.net.
    I have my database in Sql Server 2005.I have a Database table say Table1 in My Database named Test.
    Now i want to export the data in Table1 to a MS-Excel(.xls) file on the click of a button.
    An excel file should be generated after the user clicks on the button and the generated Excel file should have the data that is present in Table1.
    Can anyone provide me with a link or some helpful code to do this.
    My code is in Vb.net
    Thanks.
Working...