Dave Roberts
Dave Roberts

Reputation: 300

Distributing c# data-driven applications

I am coding a professional-level c# application for a client using an SQL back-end for the database, I wish to make this application commercially available to other people who would be able to install it their selves.

My main question is, is it possible for me to add the options for the SQL server instance, user name, password etc, as well as automate database and table generation from within the setup program and save these settings for use at run time?

Any assistance would be appreciated.

Thanks in advance.

Upvotes: 1

Views: 345

Answers (2)

Matt Westlake
Matt Westlake

Reputation: 3651

You could load them in a vector (or ArrayList) and then store that in a file somewhere on their machine. Then at startup, pull the information from the file and load it into your program.

Edit: you would have to instruct them NOT to touch the file as it would corrupt their install. I would recommend making it a file in a hidden folder somewhere on their drive where they won't be inclined to mess with it. If you can (I'm personally not sure how) making it read-only except from within the program itself wouldn't be a bad idea.

Upvotes: 0

Munawar
Munawar

Reputation: 2587

Yes, you may take the SQL information during installation using dialogues.

Includes the database script into installer and run it after taking the SQL instance and credential information from user.

Please see this link for a working example

Once database is created, save the information on file system (a config file), somewhere in users application data or installation directory depending on need. Encrypt it if needed.

Upvotes: 1

Related Questions