Export Grid view to excel and save excel file to folder

前端 未结 7 771
Happy的楠姐
Happy的楠姐 2020-12-16 06:05

I want to save excel file which export data of grid view. I have written code to export gridview data to excel but I don\'t know how to save exported file.

Following

7条回答
  •  星月不相逢
    2020-12-16 06:34

    Folowed the link: C# Excel file OLEDB read HTML IMPORT

    Use the Extended Properties=\"HTML Import;HDR=No;IMEX=1 the select * from [tablename], tablename is returned from GetOleDbSchemaTable.

    Note: This would not load the normal excel. For that use Extended Properties=\"Excel 8.0;HDR=No;IMEX=1\, where table name will be with $ sign.

    Check sample code: Can't read excel file after creating it using File.WriteAllText() function

提交回复
热议问题