Reputation: 417
I'm using FireBird embedded in my .net application.The fellow is my connection:
the code is:
public class ImDb{
private static FbConnection _fbConnection;
public static FbConnection IMManagerConnection() {
var fbConnStringBuilder = new FbConnectionStringBuilder();
fbConnStringBuilder.ServerType = FbServerType.Embedded;
fbConnStringBuilder.UserID = "sysdba";
fbConnStringBuilder.Password = "masterkey";
//fbConnStringBuilder.ClientLibrary = @"fbembed.dll";
fbConnStringBuilder.Database = @"IMMANAGER.FDB";
_fbConnection = new FbConnection(fbConnStringBuilder.ConnectionString);
return _fbConnection;
}
}
this is my test case:
the code is:
[Test]
public void SimSymbolTest(){
FbConnection fbc=IMManager.Common.ImDb.IMManagerConnection();
fbc.Open();
Console.WriteLine("The Server Version is :" + fbc.ServerVersion);
Console.WriteLine("The database is :" + fbc.Database);
Console.WriteLine("The DataSource is :" + fbc.DataSource);
Console.WriteLine("The Version Number is: " + fbc.ServerVersionNumber);
fbc.Close();
}
In my application,it's error!!report Don't load fbembed.dll
the code is:
private DataTable ExeQuery(string sqlString){
DataSet ds = new DataSet();
FbConnection fbc = ImDb.IMManagerConnection();
try {
fbc.Open();
FbTransaction fbt = fbc.BeginTransaction();
FbCommand fbcmd = new FbCommand(sqlString, fbc, fbt);
FbDataAdapter fbda = new FbDataAdapter(fbcmd);
fbda.Fill(ds);
fbt.Commit();
} catch (Exception ex) {
MessageBox.Show(ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
} finally {
fbc.Close();
}
return ds.Tables[0];
}
And this's my directory:
help me,please!Thanks in advance!
And then I modify the code of connection,add the ClientLibrary's value:
And the Test case is running OK!
But the in application ,the Error is occured again.
Upvotes: 0
Views: 992
Reputation: 33
For Windows App it will look for the dll in the folder where the .exe file is located.
For Web app you can set the ClientLibrary property of the connection string:
connectionString="ServerType=1;User=SYSDBA;Password=masterkey;Dialect=3;Database=;ClientLibrary="
Upvotes: 0
Reputation: 417
No solution!
I had to change the FireBird Server version.
It's OK!
BTW,I'm using the Visual Web Gui in my application,the PATH problems probably about this.Maybe there are different between VWG and IIS?I don't know,just guest ;).
Upvotes: 0
Reputation: 5481
A minimal set of files for Firebird 2.5 embedded:
INTL\fbintl.conf
INTL\fbintl.dll
fbembed.dll
firebird.msg
ib_util.dll
icudt30.dll
icuin30.dll
icuuc30.dll
Microsoft.VC80.CRT.manifest
msvcp80.dll
msvcr80.dll
in your case microsoft files are missing.
Upvotes: 1