开发者

Is possible to drop a database in ADO.NET or create a new one

I've been search for example to drop a d开发者_如何学Pythonatabase and create a new one in C# using ADO.NET or etc for SQL Server.

The problem is I need to create a instance of a new database for every new licensee, the customer wants a separate database for each new licensee, I've never tried this before and I'm finding it difficult to gauge the feasibility.


It is possible. It's actually an article on MSDN knowledge base.

http://support.microsoft.com/kb/307283

You basically just connect to 'master' or any database really, and send a SQL Command to create the database.

That should get you started.


I'd be looking at SQL SMO for this.

There are examples everywhere on how this works. For example, check out this one (http://www.codeproject.com/KB/tips/CreateSQLDV.aspx).

Anything you can do manually in SQL Management Studio you can do programatically, with SMO.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜