1
Answer

Export data from DataSet to Microsoft Excel using windows forms

Ask a question
Phaniraj

Phaniraj

17y
2.4k
1
I want to Export data from DataSet to Microsoft Excel using windows forms. This is very urgent please reply if you have any idea.

I had tried the following code, But it is throwing a fatal error saying it could not able to load
excel DLL even after adding it in reference.

Excel.
ApplicationClass excel = new Excel.ApplicationClass();
Excel.Workbooks workbooks = excel.Workbooks;
Excel.
Workbook workbook = workbooks.Add(true);
excel.Cells[0,0] =
"TestData";
Excel.
Worksheet worksheet = (Excel.Worksheet)excel.ActiveSheet;
excel.Visible = true;


Answers (1)