how to share a single DB with 2 desktop app over network, app in c# and db in mssql
hey guys, I'm doing two desktop applications in c#. Each one is for 2 different people but the problem is both user/client want to share data between their App. For example: The first person installs the software at his home and the second person installs the other software at his home. Now, both users want to share a single DB.
how i should go for this? I mean, if it was a web application then i could host the dat开发者_运维知识库abase on a server. However, since it is a desktop application, I'm confused how to do it ?
if it would be webapp then i can host db on server
You will most likely want to do exactly the same thing. You will need to host the database on a server which both applications will be able to access. Either host it yourself, or use an existing service provider who can provide hosted SQL server. Depends on how much money you have to spend on it, and how capable you are with SQL administration.
A desktop application and web application both utilise the same method of accessing a SQL database, you just hook it up through the connection string. You will have to be careful about how you manage and pass the credentials in the connection string, however, as you will need to authenticate remotely over the Internet.
I believe you're going to need to set up a hosted database (web accessible), unless you want to start setting up P2P connections between the two applications which would either knowing the users home IP address or setting up a middle-man to set up the connection.
精彩评论