Please guide, how to convert a table in Sql Server 2000 to an Excel Spreadsheet programitically? I am coding in c#. Thanks a bunch.
Printable View
Please guide, how to convert a table in Sql Server 2000 to an Excel Spreadsheet programitically? I am coding in c#. Thanks a bunch.
You can use ADO.NET at both ends. System.Data.SqlClient for SQL Server and OleDb for Excel. Check www.connectionstrings.com for the correct connection string for Excel. You use SQL statements for Excel just like any other database, except that you use sheet names, sheet names with cell ranges or named cell ranges in place of table names. Check MSDN for details.
You can search VBForums too. I have several posts using ADO and VB6 but they are similar in the logic and syntax shouldnt be hard to convert. ;)
Shall MS Excel be loaded on the server? Is there any way to convert, if the Ecel is not loaded on the server?
No you dont need it on the server if your running the your converting app on a client pc with Excel installed. ;)
I am working on an asp.net application with c# as codebehind. So the code code runs on the server side. So, I guess, I would be needing MS Excel on the server.
Sounds correct.
Really? Aren't there an excel redistributable, so you don't have to install excel on the machine your code is running on?
Nope, Office apps are not redistributable. You need to purchase a license for each instance of it that you need installed. ;)
There is an Excel Viewer utility by MS that allows a user that doesnt have Excel to "view" a workbook, but I am 99% sure your cant program against it.
I'm a bit brain-dead and stressed out, preparing for phone interview with the technical team for a job I would like to get, so scuse any stupidity...
What about the office web control? you can create an application that uses that control, and then install it on many machines, whether they got Office installed or not. Or am I wrong (because then I got an ex-employer who I should take of my resume!!)
I know this is not really in the line of what you asked Sinha, so sorry for barging in your thread, but I'm just curious.
To be honest, I have not used it much and its only been experimental, no deployment. The web controls only are available to the developer if they have Office installed but for deployment? I would say a tough search on MS would be required but I'm not up to that tonight either. :(
Ps, good luck on the interview. ;)
Just thought I'd point this out. Something I stumbled across.
Note: the warning message. ;)
Ps, I edited out my product ID and licensed to. ;)
Make that 100% - you can't.Quote:
Originally Posted by RobDog888