如何通过网络(多个用户)将客户端连接到服务器数据库? [英] How to connect clients to the server database via network (multiple users) ?

查看:175
本文介绍了如何通过网络(多个用户)将客户端连接到服务器数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好喔:)



我目前正在建立一个项目,将一组办公室与他们的经理办公室联系起来..

i使用C#和SQL Server express edition 2008(.mdf文件)。

服务器应用程序((数据库))应该在经理办公室......

其他办公室是客户,他们将通过局域网或Wi-Fi网络连接到服务器数据库并插入,更新甚至删除记录...

我的问题是客户如何可以同时连接服务器数据库吗?



有什么建议或代码可以帮助我吗?

我非常感谢你的帮助:)

Hi everybody :)

I am currently building a project to connect a set of offices with their manager office..
i'm using C# and SQL server express edition 2008 (.mdf file).
The server app ((the database)) should be on the manger office ...
The other offices are clients and they'll connect to the server database by lan or wi-fi network and insert,update or even delete records...
my problem is "How the clients can connect with the server database at the same time ?"

is there any suggestion or code may help me ?
I'm very thankful for your help :)

推荐答案

访问数据库时,将安装了Sql Server实例的机器的IP地址放在连接字符串中。示例:



Put the IP address of the machine where the Sql Server instance is installed in the connection string when you access the database. Example:

connectionString="Server=XXX.XXX.XXX.XXX\SQLExpress;AttachDbFilename=c:\asd\qwe\mydbfile.mdf;Database=dbname;Integrated Security=True;Connect Timeout=30;User Instance=True;Provider=SQLOLEDB;"





其中XXX.XXX.XXX.XXX是IP地址



Where XXX.XXX.XXX.XXX is the IP Address


这篇关于如何通过网络(多个用户)将客户端连接到服务器数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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