Exception thrown when creating database
- by Bob
For some reason, I can't get embedded firebird sql to work on Windows using C#/.NET. Here's my code:
string BuildConnectionString()
{
FbConnectionStringBuilder builder = new FbConnectionStringBuilder();
builder.DataSource = "localhost";
builder.UserID = "SYSDBA";
builder.Password = "masterkey";
builder.Database = "database.fdb";
builder.ServerType = FbServerType.Embedded;
return builder.ConnectionString;
}
private void OnConnectClicked(object sender, EventArgs e)
{
string cString = BuildConnectionString();
FbConnection.CreateDatabase( cString );
FbConnection connection = new FbConnection( cString );
connection.Open();
//CreateTable();
//FillListView();
connection.Close();
}
When I call FbConnection.CreateDatabase, I get the following exception:
An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
I'm very new to SQL and Firebird in general, so I'm not sure how to resolve this issue. Anyone?