简体   繁体   English

如何以编程方式创建firebird数据库?

[英]How to programmatically create firebird database?

I have COMPUTER_WITH_DATABASE where is superserver firebird (windows) installed. 我有COMPUTER_WITH_DATABASE ,其中安装了超级服务器firebird(Windows)。 Now i need to make c# application which will connect to this COMPUTER_WITH_DATABASE and create file .fdb like for example database.fdb to be later able to connect from other computers using for example part of string like: 现在,我需要制作c#应用程序,该应用程序将连接到此COMPUTER_WITH_DATABASE并创建文件.fdb ,例如database.fdb ,以便以后能够使用例如字符串的一部分从其他计算机连接:

COMPUTER_WITH_DATABASE\\c:\\database.fdb COMPUTER_WITH_DATABASE \\ C:\\ database.fdb

But how to do it using fb API in c#? 但是如何在c#中使用fb API做到这一点?

with this code you can create a database: 使用此代码,您可以创建数据库:

...
using FirebirdSql.Data.Firebird;
...

FbConnectionStringBuilder builder = new FbConnectionStringBuilder();
builder.DataSource = "COMPUTER_WITH_DATABASE";
builder.UserID = "SYSDBA";
builder.Password = "m*******y";
builder.Database = @"c:\database.fdb";
builder.ServerType = FbServerType.Default;

FbConnection.CreateDatabase(builder.ConnectionString);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM