Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. C# and ms excel spreadsheet

C# and ms excel spreadsheet

Scheduled Pinned Locked Moved C#
databasehelpcsharpcsssql-server
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    phokojoe
    wrote on last edited by
    #1

    I have a data stored in MS SQL server database table. Since my users do not have direct access to the database tables, I am developing a system for them to query the tables and the data will be displayed in the datagrid and they can click a button and data exported to Ms excel. I am able to display data in the datagrid based on the query I have written but getting data from data grid to excel is a problem .:((I have tried everything but no solution. I am able to open a notepad but with ms excel, I can not. Can anybody help me.

    phokojoe

    N S 2 Replies Last reply
    0
    • P phokojoe

      I have a data stored in MS SQL server database table. Since my users do not have direct access to the database tables, I am developing a system for them to query the tables and the data will be displayed in the datagrid and they can click a button and data exported to Ms excel. I am able to display data in the datagrid based on the query I have written but getting data from data grid to excel is a problem .:((I have tried everything but no solution. I am able to open a notepad but with ms excel, I can not. Can anybody help me.

      phokojoe

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      phokojoe wrote:

      I have tried everything but no solution

      Everything except this http://www.google.com/search?source=ig&hl=en&q=DataGrid+to+Excel&btnG=Google+Search[^]


      only two letters away from being an asset

      1 Reply Last reply
      0
      • P phokojoe

        I have a data stored in MS SQL server database table. Since my users do not have direct access to the database tables, I am developing a system for them to query the tables and the data will be displayed in the datagrid and they can click a button and data exported to Ms excel. I am able to display data in the datagrid based on the query I have written but getting data from data grid to excel is a problem .:((I have tried everything but no solution. I am able to open a notepad but with ms excel, I can not. Can anybody help me.

        phokojoe

        S Offline
        S Offline
        swjam
        wrote on last edited by
        #3

        What you need my friend is to add Microsoft.Office.Interop.Excel assembly to your project

        I am a SysAdmin, I battle my own daemons.

        P 1 Reply Last reply
        0
        • S swjam

          What you need my friend is to add Microsoft.Office.Interop.Excel assembly to your project

          I am a SysAdmin, I battle my own daemons.

          P Offline
          P Offline
          phokojoe
          wrote on last edited by
          #4

          I do not quite understand how to add the microsoft.office.interop.excel. Guys the examples I have found when searching through google were those for asp.net or vb.net. I am only interested in the C#.net part of it. Can anybody show me how to make the first step, the rest i can follow. Please

          phokojoe

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups