Creating Firebird database programatically (C#/.NET)
Well, after Creating Firebird database programatically (Delphi) post I’m bringing the example “How to create FB database programatically from .NET?".
The solution is easy too. 😃 You can just use (and also extend) this simple function. It uses the Firebird ADO.NET Data Provider.
static void CreateFBDatabase(string host, string fileName, string user, string password, int pageSize, bool forcedWrites, bool overwrite)
{
FbConnectionStringBuilder csb = new FbConnectionStringBuilder();
csb.Database = fileName;
csb.DataSource = host;
csb.UserID = user;
csb.Password = password;
FbConnection.CreateDatabase(csb.ConnectionString, pageSize, forcedWrites, overwrite);
}