0
If you don't have Excel installed you could use following freware library to write Excel files:
http://www.carlosag.net/Tools/ExcelXmlWriter/Default.aspx
I'm using this library and it is easy to use.
I think you have Excel installed so try to look at this example :
http://www.c-sharpcorner.com/Code/2004/June/AccessExcelDb.asp
buller
0
I already have a connection and can read the dataset in a datagrid on my App....I just need to export it to Excel....
Thanks
Chuck
0
Here is what I posted in another thread:
The first and more "civilised" one is with ODBC data source through OleDB. I have never tried this but it should work. Do the following:
Run "Data sources (ODBC)" from Administrative tools. Go to tab "System DSN"
Click add, then choose Microsoft Excel driver. Type the name of the data source, say "Excel test". Click finish and then Select workbook. This normally is enough but you've got to build the ConnectionString by hand. Here is a workaround.
Create a new text file, change it's extension to .udl and click properties. You get the datalink properties. Go to Connection tab and from the "Use data source name" combo choose your newly created data source. It must be there. That's all, click OK and open the .udl file with a text editor and you've got the connection string. Mine is
"Provider=MSDASQL.1;Persist Security Info=False;Data Source=Excel test"
Now create the OleDbConnection object and bla bla bla