C# and ms excel spreadsheet
-
I have a data stored in MS SQL server database table. Since my users do not have direct access to the database tables, I am developing a system for them to query the tables and the data will be displayed in the datagrid and they can click a button and data exported to Ms excel. I am able to display data in the datagrid based on the query I have written but getting data from data grid to excel is a problem .:((I have tried everything but no solution. I am able to open a notepad but with ms excel, I can not. Can anybody help me.
phokojoe
-
I have a data stored in MS SQL server database table. Since my users do not have direct access to the database tables, I am developing a system for them to query the tables and the data will be displayed in the datagrid and they can click a button and data exported to Ms excel. I am able to display data in the datagrid based on the query I have written but getting data from data grid to excel is a problem .:((I have tried everything but no solution. I am able to open a notepad but with ms excel, I can not. Can anybody help me.
phokojoe
phokojoe wrote:
I have tried everything but no solution
Everything except this http://www.google.com/search?source=ig&hl=en&q=DataGrid+to+Excel&btnG=Google+Search[^]
only two letters away from being an asset
-
I have a data stored in MS SQL server database table. Since my users do not have direct access to the database tables, I am developing a system for them to query the tables and the data will be displayed in the datagrid and they can click a button and data exported to Ms excel. I am able to display data in the datagrid based on the query I have written but getting data from data grid to excel is a problem .:((I have tried everything but no solution. I am able to open a notepad but with ms excel, I can not. Can anybody help me.
phokojoe
-
What you need my friend is to add Microsoft.Office.Interop.Excel assembly to your project
I am a SysAdmin, I battle my own daemons.
I do not quite understand how to add the microsoft.office.interop.excel. Guys the examples I have found when searching through google were those for asp.net or vb.net. I am only interested in the C#.net part of it. Can anybody show me how to make the first step, the rest i can follow. Please
phokojoe