出于某种原因,我不能让嵌入式Firebird SQL使用C/.NET在Windows上工作。以下是我的代码:
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();
connection.Close();
}
当我调用fbconnection.createDatabase时,我得到以下异常:
试图加载格式不正确的程序。(来自hresult的异常:0x8007000b)
我对SQL和Firebird非常陌生,所以我不确定如何解决这个问题。有人吗?