Firebird connection in C#

10,336

So your datasource part should be datasource=10.48.14.51 without any extra path. The database part should be your network path to the database like "database=\server\path\database.fdb"

Putting all together I will try in this way:

viewdataConnection.ConnectionString = "User ID=sysdba;Password=masterkey;" + 
"Database=\\server\share\database.fdb;DataSource=10.48.14.51;Charset=NONE;"; 

of course you need to change \server\share\database.fdb with your exact network path.

Share:
10,336
Elfoc
Author by

Elfoc

Updated on June 04, 2022

Comments

  • Elfoc
    Elfoc almost 2 years

    i have problem with connection..

    I can connect without problems to my database, when this database is downloaded on my computer:

    viewdataConnection.ConnectionString = "User ID=sysdba;Password=masterkey;Database=localhost:F:\\machine.FDB;DataSource=localhost;Charset=NONE;"
    

    everything is working fine.

    But problems starts when i try to connect to this base in lan network:

    viewdataConnection.ConnectionString = "User ID=sysdba;Password=masterkey;Database=10.48.14.51:d:\\backup\\machine.fdb; DataSource=:d:\\backup\\machine.fdb;Charset=NONE;";
    

    and this don't work also:

    viewdataConnection.ConnectionString = "User ID=sysdba;Password=masterkey;Database=10.48.14.51:d:\\backup\\maszyna.fdb; DataSource=:10.48.14.51:d:\\backup\\maszyna.fdb;Charset=NONE;";
    

    then i get error about invalid token "second" in my sql query, but this query works when database is on localhost.. so probably there's mistake in my connectionstring..

    Why?

    • Steve
      Steve about 12 years
      I don't understand. You tell us 'problems with base on lan network' but the paths you give in the example refers to a local path. They shoulf be something like '\\server\share\database.fdb'
    • Elfoc
      Elfoc about 12 years
      Sorry for not clear explanation, check my edit - i want to connect to database located on 10.48.14.51 in my network..
  • Elfoc
    Elfoc about 12 years
    This is good, but... server runs on old version of firebird without function that i use :)