Access Database on client machine from Web Application

Asked

Viewed 255 times

0

Hello, good afternoon.

I’m developing a system that has only one code for several databases. The system already implemented almost all, but when I started to test the connection on the client machine, after I publish, it is always coming the data that are in the base of the server that the system was published.

Could the system connect on a base that is on the client local machine? I am new in these matters and has anyone gone through it?

I’m using C# and Asp Net.

  • Edit Webconfig, change the Connectionstring and point to the local database.

  • But that way, after I publish it will fetch on the client machine?

  • I have two Webconfig. One site and one remote. When I publish I do not overwrite Webconfig.

1 answer

2

I don’t know if that’s the need, but if there really is a database server started on each client, you can configure your application to grab the client’s IP and connect the BD on that IP. I did something similar in php a while ago here in the service and it worked.

  • Um, I get it, I haven’t tried yet, I’m gonna try something here, if I have a question or if it works, I’ll come back here.

  • Beauty! Changing the Connectionstring to the local bank as the colleague mentioned will not work, because then the application will point to her local bank (localhost) where the system is published.

  • 1

    I tested it by typing an ip to get it, and it worked. Ball show, if typing the ip worked, I believe that when he catch the client machine IP try to access works as well. Thanks to the brother, for the tip. He helped me.

  • I tested taking the IP of the client machine, I tested it on different machines, and it worked well. But I had a question. And when I’m on a different network and the database server IP is not?

  • If they are on another network and outside the same intranet, you will have to publish all your clients on the internet. It’ll be a hell of a job if you have a lot of machines, rsrs. Here explains this process well: http://ptcomputador.com/Ferragens/servers/62338.html. I find it particularly appropriate and safe for your system to create an intranet and configure your clients on it. Hug!

Browser other questions tagged

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