You must Sign In to post a response.
  • Category: ASP.NET

    Get details from db and write to excel C#

    I have a table (tbl_datasourceinfo) in database where I have the details of three different databases.

    The field name of the table are tableid,datasourcename and sqlqueryname.

    The Connection String will be there in the column DatasourceName and the Select query (select * from table1) will be there in the column sqlqueryname.

    From dotnet C# code I need to execute these three select queries in the table (tbl_datasourceinfo)and write the results to excel sheet. Can anyone help me with the logic or sample code please?
  • #769222
    Hi, refer to this

    http://www.c-sharpcorner.com/UploadFile/83fe73/solutions-to-export-data-from-database-to-excel-in-C-Sharp/


  • Sign In to post your comments