如何在运行时使用C#..创建数据库?

问题描述:

我想在我的应用程序第一次运行时创建一个数据库文件,然后每次都使用该数据库文件.


我在应用程序中使用了我的数据库的SQL脚本.因此,我希望如果该数据库文件不存在于目标位置,那么它将从此SQL脚本自动创建.

I want to create a database file when my application run first time, then use that database file every time.


I have a SQL Script of my DB used in application. so i want that if the database file is not present at the destination then it will create automatically from this SQL Script.

这些可能会帮助您
http://support.microsoft.com/kb/307283 [使用C#创建SQL Server数据库 [
These might help you out
http://support.microsoft.com/kb/307283[^]
Create a SQL Server Database Using C#[^]


它可能对您有帮助,

以编程方式创建数据库MCB [
It might help you,

Creating DB Programmatically MCB[^]

:)