Database to Excel file?

ComputerNovice

Baseband Member
Messages
22
I need to write a program that will connect to a Microsoft Server 2008 database and write the contents of a table into an Excel file, which will be saved on the directories of multiple workstations. Lastly, this program will clean up the target directory of any files older than 3 days. This program will be kicked off by Control M scheduler.

I am comfortable with C# and SQL. But I'm only familiar with connecting a GUI program to a database and displaying the data to the user, on a Windows form.

Is this still possible with a C# program, such as a console application? Maybe even VB?

Or do I need to do this in another scripting language, such as a T-SQL script? I wasn't sure if T-SQL can even clean up directories of old files.

Any pointing in the right direction would be greatly appreciated!
 
You'd need to use C# to delete/manage your directories and database access. SQL is just database language that manage the content of your database. You're probably better off making a C# service application (Alternatively, just compile your application as Windows Application while not initializing any form or gui) that regulate your directory and keeping it in sync with the database, so you can write newer files. Then finally, you could develop a secondary application that provide the gui for your users to change the option of the service as well as accepting input to access database, time to sync, limiting memory usage, network bandwidth, and various preferences.

I hope this helps a little.
 
You'd need to use C# to delete/manage your directories and database access. SQL is just database language that manage the content of your database. You're probably better off making a C# service application (Alternatively, just compile your application as Windows Application while not initializing any form or gui) that regulate your directory and keeping it in sync with the database, so you can write newer files. Then finally, you could develop a secondary application that provide the gui for your users to change the option of the service as well as accepting input to access database, time to sync, limiting memory usage, network bandwidth, and various preferences.

I hope this helps a little.

Would a service be necessary? Unless the process would need to be run on a schedule rather than on-demand, a simple console app could be made. Or, if you rather, a full GUI could be made as well.

The console app would just have an interface that requires more interaction than just clicking a button.
 
Back
Top Bottom