0

I'm using FireBird embedded in my .net application.The fellow is my connection: The FireBird 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: my test case,it's run ok

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 My application snippet

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:

my directory

help me,please!Thanks in advance!

And then I modify the code of connection,add the ClientLibrary's value: ClientLibrary has assigned

And the Test case is running OK!

But the in application ,the Error is occured again. enter image description here

embedded.kyle
  • 10,976
  • 5
  • 37
  • 56
bnPYSse
  • 397
  • 4
  • 12
  • Please update with actual code rather than screenshots... this allows others to search for the same problem. – spender Nov 25 '12 at 01:42
  • I see there some ASP.NET pieces. Are you sure you're running application from this directory? Maybe it's actually run from different directory - IIS (Express) etc. – cincura.net Nov 25 '12 at 09:52

3 Answers3

1

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.

Andrej Kirejeŭ
  • 5,381
  • 2
  • 26
  • 31
  • These file are not necessary. These might be installed with other product. – cincura.net Nov 26 '12 at 06:05
  • I think the key to the problem is: test cases no problem, but only in the application there are problems.Then I copy the files of msv*.dll to the bin directory,the problems still exist. – bnPYSse Nov 26 '12 at 14:33
  • In your app the line of assigning client library is commented //fbConnStringBuilder.ClientLibrary = @"fbembed.dll"; why? – Andrej Kirejeŭ Nov 26 '12 at 14:40
0

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 ;).

bnPYSse
  • 397
  • 4
  • 12
0

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="

Anca
  • 33
  • 6