用一个数据库连接两个应用程序 [英] connect two applications with one database

查看:220
本文介绍了用一个数据库连接两个应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi



我有一个Web应用程序和桌面应用程序,都是由C#编写的,使用visual studio。我的问题是如何将这两个应用程序连接到同一个数据库?



请给我任何参考或步骤因为我不是命题我是初学者。



谢谢



[由op更新]

我关于投票的项目系统通过使用指纹,但因为我无法将指纹设备与Web应用程序连接,我决定在桌面应用程序中进行,并且(选民,候选人)可以在Web应用程序中注册。我使用SQL Server 2008 express R2,我已经为Web应用程序构建了数据库。我将在桌面应用程序中创建其他数据库来存储指纹。那我该怎么办?我可以创建其他数据库来将指纹存储在桌面应用程序中并将其与Web应用程序的数据库连接吗?或者什么?

hi

I have a web application and desktop application both written by C#, using visual studio. my question is how to connect these both applications with the same database ?

please give my any reference or steps because I''m not propositional I''m beginner.

Thanks

[update by op]
My project about Voting System by using finger print but because i cant connect the fingerprint device with the web application i decided to make it in desktop application and the (voters, candidates) can register in the web application. I using SQL Server 2008 express R2 and i already built the database for the web application. I will create other database in desktop application to storing the fingerprints. So what can I do? can I create other data base for storing the fingerprint in desktop application and connect it with the web application''s database? or what ?

推荐答案

如果你想让多个应用程序使用同一个数据库,那么你所需要的就是确保通过多用户服务器数据库系统访问数据库 - 例如,Sql Server或MySql。它将您与实际文件隔离开来,并为您处理所有多用户访问内容。



因此,将数据库设置在桌面计算机和桌面计算机上的SQL Server实例上托管您的Web应用程序的服务器可以访问,您应该没问题。
If you want to have multiple applications using the same DB then all you need is to ensure that you access the DB via a multiuser server DB system - Sql Server or MySql for example. It insulates you from the actual file and handles all the multiuser access stuff for you.

So set your DB up on an SQL Server instance that both your Desktop machines and the server hosting your web app can access and you should be fine.


这篇关于用一个数据库连接两个应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆