I've a requirement to create DB by taking the DB name from the C# application. Basically, avoiding hard-coding of DBname in the sql script. ex: "create Database abc". In this "abc" must be passed as parameter.
Once i read the DBName from the application, can anyone please suggest how to pass DBName to the script file? The Script file will be read by the C# application again and executes it.
-Prashanth
You can do two things:
Use a dynamic statement, and use it to create the database:
Pass in the name as parameter.
Create the statement in .NET: