How do I create a Firebird database file programmatically?
I've written code using SQLite (C# .NET, System.Data.SQLite) ... decided to try Firebird.
To install Firebird: Windows 7 -> Visual Studio 2013 -> File -> New -> Project, etc. ---------- then Tools -> Library Package Manager -> Manage NuGet Packages -> search "firebird" -> Firebird ADO.NET Data provider -> Install (button).
Resulted in a) References -> FirebirdSql.Data.FirebirdClient, and b) FirebirdSql.Data.FirebirdClient.5.8.0 subdir ... with Firebird .dll's.
To create a Firebird database file, I've tried (extracted from another StackOverflow post):
int pageSize = 4096;
bool forcedWrites = true;
bool overwrite = false;
var connectionString = new FbConnectionStringBuilder
{
Database = stPathFilename,
ServerType = FbServerType.Embedded,
UserID = "SYSDBA",
Password = "masterkey",
ClientLibrary = "fbclient.dll"
}.ToString();
FbConnection.CreateDatabase(connectionString, pageSize, forcedWrites, overwrite);
I had presumed this is standard, except for the stPathFilename. However, this code throughs an exception ... complains about fbclient.dll.
Then I tried
ClientLibrary = "FirebirdSql.Data.FirebirdClient.dll"
... which is located in my Debug subdir.
This throws an exception ... "Unable to find an entry point named 'isc_create_database' in DLL 'FirebirdSql.Data.FirebirdClient.dll".
How do I create a Firebird database file programmatically?