简体   繁体   中英

Connect application in C# Windows Forms with firebird database (LAN Network)

I have problem with connect C# application with firebird database. I added

using FirebirdSql.Data.FirebirdClient;

The connection to the database follows through

FbConnection polaczenie = new FbConnection("User ID=SYSDBA; Password=masterkey;" + "Database=D:\\vs\\bazavs.gdb;");

As the database is locally, everything works fine, the problem is to connect to lan network.

FbConnection polaczenie = new FbConnection("User ID=SYSDBA; Password=masterkey;" + "Database=192.168.14.100:\\vs\\bazavs.gdb;");

Does not work. I would like connect to database on linux server + samba.

A Firebird database should not be connected through a network share, so you should not be using Samba to access your Firebird database (doing so from multiple clients could corrupt your Firebird database!). You need to install Firebird server on the machine hosting the database file, and use that to connect to your database file.

The second problem is that your connection string is wrong. Assuming you have Firebird installed on 192.168.14.100 , you should be using the connection string:

"User ID=SYSDBA; Password=masterkey;Database=/vs/bazavs.gdb;DataSource=192.168.14.100;Port=3050

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM