Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to programmatically create firebird database?

I have COMPUTER_WITH_DATABASE where is superserver firebird (windows) installed. 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:

COMPUTER_WITH_DATABASE\c:\database.fdb

But how to do it using fb API in c#?

like image 414
user1654591 Avatar asked Jun 01 '26 06:06

user1654591


1 Answers

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);
like image 57
jadelgado Avatar answered Jun 03 '26 20:06

jadelgado



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!