Export Datagrid data to Excel?

Discussion in 'ASP .Net Datagrid Control' started by et, Jun 27, 2005.

  1. et

    et Guest

    How can I export data from a grid into Excel? Or from a datatable?

    I don't have a query I am displaying the schema from a database using a
    datatable, and now I want to export it to excel:
    dtFields = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Columns, New Object()
    {Nothing, Nothing, Nothing, Nothing})

    dg.DataSource = dtfields

    dg.DataBind
    et, Jun 27, 2005
    #1
    1. Advertising

  2. et

    Elton Wang Guest

    Take look following url:

    http://support.microsoft.com/default.aspx?scid=kb;en-us;317719

    HTH

    Elton Wang

    "et" <> wrote in message
    news:...
    > How can I export data from a grid into Excel? Or from a datatable?
    >
    > I don't have a query I am displaying the schema from a database using a
    > datatable, and now I want to export it to excel:
    > dtFields = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Columns, New Object()
    > {Nothing, Nothing, Nothing, Nothing})
    >
    > dg.DataSource = dtfields
    >
    > dg.DataBind
    >
    >
    Elton Wang, Jun 27, 2005
    #2
    1. Advertising

  3. et

    et Guest

    That will do it! Thanks.


    "Elton Wang" <> wrote in message
    news:...
    > Take look following url:
    >
    > http://support.microsoft.com/default.aspx?scid=kb;en-us;317719
    >
    > HTH
    >
    > Elton Wang
    >
    > "et" <> wrote in message
    > news:...
    >> How can I export data from a grid into Excel? Or from a datatable?
    >>
    >> I don't have a query I am displaying the schema from a database using a
    >> datatable, and now I want to export it to excel:
    >> dtFields = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Columns, New Object()
    >> {Nothing, Nothing, Nothing, Nothing})
    >>
    >> dg.DataSource = dtfields
    >>
    >> dg.DataBind
    >>
    >>

    >
    >
    et, Jun 27, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sunilkumar Reddy via DotNetMonster.com

    Export to excel data from Datagrid rows

    sunilkumar Reddy via DotNetMonster.com, Jun 27, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    656
    sunilkumar Reddy via DotNetMonster.com
    Jun 27, 2005
  2. chandan
    Replies:
    1
    Views:
    1,759
    Cowboy \(Gregory A. Beamer\)
    Oct 14, 2008
  3. Grey

    export datagrid data to Excel file

    Grey, Jan 9, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    166
  4. Paul D. Fox

    Display a Datagrid & Export a Datagrid to Excel

    Paul D. Fox, Jul 21, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    224
    Elton Wang
    Jul 21, 2005
  5. chandan
    Replies:
    1
    Views:
    321
    Nafly
    Oct 16, 2008
Loading...

Share This Page