I am new to .net, so i will be really thankful to u if u could help me on how to display a SQL table on an EXCEL form through the dataset without using the Gridview.
Please tell me in detail on how i need to proceed...
I have a code where i use a gridview. please find it.
How to import the data from an sql table to an Excel without using gridview?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Mahesh ChandRank #1 · 393K pointsPosted Mar 16, 2011, 7:38 AM EDT
Here are the required steps.
1. You need to get all data in a DataSet or DataTable, which you may already have in your application.
2. You need to create an Excel sheet (search this website on how to create an excel sheet). Then add columns to it or use default columns.
3. Get data from DataTable or DataSet, one row at a time and add rows to your Excel sheet
You will use Office Interop to build the Excel sheet and add data to it.
Also, look at Office Interop section of this website.
Good luck!
Suthish NairRank #93 · 22.6K pointsPosted Mar 16, 2011, 11:45 AM EDT