Create database by C# code in a directory which sql server create its databases
I want to create a sql database by C# code in a directory in server whi开发者_高级运维ch sql server create its databases in it.
how can i do that?
Here is a code snippet for what you are asking.
How To Create A SQL Server Database Programmatically with ADO.NET
if you are using SQL Server 2008 you can use the Sql Server Management objects (SMO)
精彩评论