How to use Firebird database on network with C#?

Asked

Viewed 899 times

1

I developed a C# Windows Forms application with Firebird database and I need to place the application with the database on a machine that will be like a server. With this, I need to access this server database by other machines that will be on the same network. How do I do this? What do I need to configure? If anyone has a tutorial link to show me.

Thank you!

  • I don’t think you should do that. Separate your web servers from the database server whenever possible, but if you HAVE to take that risk. Well, in that case, assuming your application is already working, you just need to set up your computer as a web server so that other people have access to your application and the content it manages in the database. https://www.youtube.com/watch?v=hlDNct5lokA

  • 1

    @Johndoe, its application is not WEB. It is a Windows Forms desktop application. To solve this, you need to place Firebird access Dlls on each machine. Also, in your EXE, you should point the connection string to the server where the database will be. After you identify everything you need to run on a machine, make an installer to make it easy.

  • To connect locally use a string with these parameters: User=SYSDBA; Password=masterkey; Database=C: BANCO.fdb; Datasource=localhost; Port=3050; Dialect=3; Charset=WIN1252; Role=; Connection Lifetime=0; Connection timeout=15; Pooling=True; Packetsize=16384; Server Type=0;

  • 2

    @Andrémoraismartins, it can’t be localhost. You are using Localhost because you are developing on the same machine where Firebird is running. Since you will have a scenario where Firebird will run on one machine and the others will have access to it, then your connection string should change. Your Datasource, therefore, should be the IP or DNS of the machine where FB is running.

  • Oops! Sorry, you guys!!!

  • 1

    Guys, I did a test here on another app and it apparently worked! In the connection string I changed these parameters: Database= BANCO.fdb; Datasource=192.168.0.103; Thank you very much!

  • @Andrémoraismartins, posted an answer, please check if you answer.

Show 2 more comments

2 answers

1


The problem is occurring, because in the connection string is being used the localhost.

Is used localhost in cases where the database runs on the same application machine. It is a common scenario when developing.

However, the most common (and recommended) is to place the seat and application on different machines.

Thus, as Firebird will run on one machine and the others will have access to it, the connection string must change. The Datasource item of the connection string should therefore point to the IP or DNS of the machine where FB will run.

0

vc can use the following connection string:

User=SYSDBA;Password=masterkey;Database=c:\dados\meubanco.fdb;DataSource=NomeDoServidor;
Port=3050;Dialect=3;Charset=NONE;Role=;Connection lifetime=15;Pooling=true;
MinPoolSize=0;MaxPoolSize=50;Packet Size=8192;ServerType=0;

where:
Database = caminho database path on server
and
DataSource = nome do servidor, can also use the IP address of the server.

you need to install Firebird on all the machines that will access the bank.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.