我想在局域网中使用c#应用程序连接sql express数据库. [英] I want to connect sql express database using c# application in LAN.

查看:128
本文介绍了我想在局域网中使用c#应用程序连接sql express数据库.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我想使用局域网中的c#应用程序连接sql express数据库.
我在一台计算机上安装了sql Express,我想从局域网中的另一台计算机连接它.
我该怎么办?
plz help

Hello,
I want to connect sql express database using c# application in LAN.
I have sql Express installed on one machine,i want to connect it from other machine in LAN.
How should i do this?
plz help

推荐答案

基本上,您可以使用连接字符串连接到数据库 [ ^ ].当然,这取决于您要连接到哪个数据库服务器.在此处检查[ ^ ]用于不同的连接字符串.您还需要熟悉 ADO.Net [ System.Data.SqlClient [ ^ ]命名空间,因此确保您也进行了检查.
Basically, you connect to a database by using Connection Strings[^]. This will, of course depend on what database server do you want to connect to. Check here[^] for the different connection strings. You also need to familiarize yourself with ADO.Net[^] in order to connect to the database, using the connection string. Most of the classes that you will need are in System.Data.SqlClient[^] namespace so make sure you check on it as well.




您可以以与本地计算机相同的方式在LAN(在不同计算机上)上使用SQL Express.只需在连接字符串中提供安装SQL Express的计算机的IP地址和SQL实例名称,如下所示:
Hi,

You can use SQL Express on LAN(on different machine) in the same way as on local machine. Just give IP address of the machine where SQL express is installed and SQL instance name in the connection string like below:
<br />
Data Source=192.168.0.52\SQLExpress; User ID=sa; Password=YourPassword; Initial Catalog=YourDatabase;



您还需要配置SQL Server以允许远程连接
http://support.microsoft.com/kb/914277 [



You also need to configure SQL Server to allow remote connection
http://support.microsoft.com/kb/914277[^]


astika ..首先.配置表面区域配置.到模式允许同时使用Tcp/IP.然后使用系统名称打开SSMS.connect.使用服务器配置.
astika..First..Configure Your Surface Area Configuration.To Mode That Allow Both Tcp/IP..Then.Open Your SSMS..connect using the system name..Using Server Configuration.


这篇关于我想在局域网中使用c#应用程序连接sql express数据库.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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