Firebird Database with Visual Studio 2008 not working

0

I am on Windows 7 with Visual Studio 2008. I installed Firebird 3.0 (the latest version), and I wanted to connect to the database using C#. I also installed Firebird DDEX for Visual Studio 2008. However, when I tried to add firebirdSql.Data.FirebirdClient.dll to the reference in the project, it gave an yellow triangle with an exclamation mark inside.

Some old Stack Overflow solutions said I should install an older version of Firebird, so I uninstalled version 3.0, and replaced it with version 2.5.2. I now have FirebirdSql.Data.FirebirdClient.dll added to the reference without the yellow triangle problem.

However, it looks like this is not the only issue. I wrote my program similar to this example:

string connectionString =
    "User=SYSDBA;" +
    "Password=masterkey;" +
    "Database=temp.fdb;" +
    "DataSource=localhost;" +
    "Port=3050;" +
    "Dialect=3;" +
    "Charset=NONE;" +
    "Role=;" +
    "Connection lifetime=15;" +
    "Pooling=true;" +
    "MinPoolSize=0;" +
    "MaxPoolSize=50;" +
    "Packet Size=8192;" +
    "ServerType=0";

FbConnection myConnection = new FbConnection(connectionString);

try{
    // Open connection
    MessageBox.Show("Open connection");
    myConnection.Open();

    // Close connection
    MessageBox.Show("Close connection");
    myConnection.Close();
}
catch(Exception ex){
    MessageBox.Show(ex.Message);

}

I have my temp.fdb in my application directory. I have also created database and a table with some data in it using command prompt. However, this gives an error:

I/O error during "CreateFile(open)" operation for file "temp.fdb" Error while trying to open file.

I changed it the ServerType from 0 to 1, and I got a new error:

Unable to load DLL 'fbembed': The specified module could not be found. (Exception from HRESULT: 0x8007007E)".

When I try to add fbembed.dll to the reference, it gives the following error:

A reference to '.....\bin\fbembed.dll' could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component

When I did some research on this, I found I need to have all icu*.dll's, intl folder, and udf folder in the application directory as well. So I moved all of those to the application directory, but I am still getting the same error.

Can someone give me some advice on how to fix this issue?

c#
database
dll
firebird
asked on Stack Overflow Jul 25, 2017 by JessicaD • edited Jul 27, 2017 by nalyd88

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0