Question : Creating SQL Database during .NET setup

I am creating a setup/deployment project for a Windows Service.  During the setup/installaton, I need to get the server name from user input and modify the connection string in the app.config file and then run a batch file to create a directory for a SQL database.  Then run a SQL script to create the database.        I've been Googling for days and cannot seem to find a straight forward step by step example of this.  

Answer : Creating SQL Database during .NET setup

To edit the app.config file from within your program take a look at:
http://www.codeproject.com/KB/cs/SystemConfiguration.aspx (look for "How To Read/Write Another App.Config File")

To create a batch file take a look at:
http://www.csharp-station.com/HowTo/ReadWriteTextFile.aspx

To execute a batch file take a look at:
http://www.123aspx.com/redir.aspx?res=27860

To execute a script file in 2005 look at:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=99084
Random Solutions  
 
programming4us programming4us