Export DataGrid Data to Excel File.

  • Hi,

    In my web page, the Datagrid gets the data from SQL server 2000 by using Stored procedure. After getting the data, it need to be saved an Excel File.

    I have used C# code to transfer data from Datagrid to Excel file, its working fine if the record is less than 10,000 in grid but if record is more then it is making an error message as

    " Unexpect Error. 0*00000972 like this. "

    and sometime making halt or not functioning my application.

    This is a Live Application, So

    Now Here is my requirements :

    I wants to create a procedure, which will take 3no. parameter

    like ( 1st - Pathname, 2nd - Filename, 3rd - SqlQuery )

    Inputs : @Pathname, @Filename, @sqlquery

    Logic : It will check the path exist or not,

    It will check the file exist or not, if not create, if yes append.

    SqlQury is correct or not.

    Output should be :

    It will store the result set into the excel file returned

    by SqlQuery.

    (SN : it should create automatically the Excel file and the column and

    store the data)

    Please help me!

    Cheers!

    Sandy.

    --

  • Sandy (12/18/2007)


    Hi,

    In my web page, the Datagrid gets the data from SQL server 2000 by using Stored procedure. After getting the data, it need to be saved an Excel File.

    I have used C# code to transfer data from Datagrid to Excel file, its working fine if the record is less than 10,000 in grid but if record is more then it is making an error message as

    " Unexpect Error. 0*00000972 like this. "

    and sometime making halt or not functioning my application.

    This is a Live Application, So

    Now Here is my requirements :

    I wants to create a procedure, which will take 3no. parameter

    like ( 1st - Pathname, 2nd - Filename, 3rd - SqlQuery )

    Inputs : @Pathname, @Filename, @sqlquery

    Logic : It will check the path exist or not,

    It will check the file exist or not, if not create, if yes append.

    SqlQury is correct or not.

    Output should be :

    It will store the result set into the excel file returned

    by SqlQuery.

    (SN : it should create automatically the Excel file and the column and

    store the data)

    Please help me!

    Cheers!

    Sandy.

    You can find some valuable informations here

    http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49926


    Madhivanan

    Failing to plan is Planning to fail

  • Hey Madhivanan,

    I have Resolved this Issue by own,

    Thanks for your help.

    Cheers!

    Sandy.

    --

  • Sandy (12/28/2007)


    Hey Madhivanan,

    I have Resolved this Issue by own,

    Thanks for your help.

    Cheers!

    Sandy.

    Would you mind posting the solution? 🙂


    Madhivanan

    Failing to plan is Planning to fail

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply