Export to Excel from sql server table in .net windows application

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ruchikapali
    New Member
    • Oct 2008
    • 4

    #1

    Export to Excel from sql server table in .net windows application

    Hi All!!
    Actually I am searching for a program that will export my sql server table into excel using windows based application. If some one knows any faster approach then do help me plz.

    Ruchika
  • Curtis Rutland
    Recognized Expert Specialist
    • Apr 2008
    • 3264

    #2
    You can do that directly from Excel.

    Here's an article on how to do it in Office 2007:

    Comment

    • matthewaveryusa
      New Member
      • Jul 2008
      • 20

      #3
      There is a very good free Microsoft tool named LogParser 2.2 here:
      http://www.microsoft.com/downloads/d...displaylang=en

      Read the help file, it has all the examples, commands and useful information you will need. I use this tool all the time. Can be used with any DB as long as you have the connector installed on your pc

      Comment

      • ruchikapali
        New Member
        • Oct 2008
        • 4

        #4
        I want to use .net code for tis or any sql code will also work
        thankX in advance

        Comment

        • Curtis Rutland
          Recognized Expert Specialist
          • Apr 2008
          • 3264

          #5
          Originally posted by ruchikapali
          I want to use .net code for tis or any sql code will also work
          thankX in advance
          Well, you can get the data from the database using the System.Data.Sql Client namespace. We have 2 articles on using databases in your .NET program in the Howtos section.

          As to putting it in excel, you have two choices. You can either treat your excel doc like a database and use OleDb (System.Data.Ol eDb) exactly like you used the SqlClient. Or you could look up using COM Interop.

          Comment

          Working...