简体   繁体   English

客户端-服务器应用程序的VB.NET连接字符串

[英]VB.NET connection string for client-server application

Case : 案件 :

I'm creating a desktop application with VB.NET (Windows Forms), and using SQL Server 2008 Express for its database. 我正在使用VB.NET(Windows窗体)创建桌面应用程序,并将SQL Server 2008 Express用于其数据库。

Problem : 问题:

I want to create a client-server application, it means I just need 1 database on the server. 我想创建一个客户端-服务器应用程序,这意味着我在服务器上只需要1个数据库。

I have a computer and a laptop. 我有一台电脑和一台笔记本电脑。 I set my laptop's IP to 192.168.1.1 and my computer's IP to 192.168.1.2 . 我将笔记本电脑的IP设置为192.168.1.1并将计算机的IP设置为192.168.1.2

Now I place the database on my computer, the database name is db_transportasi . 现在,将数据库放置在计算机上,数据库名称为db_transportasi

Problem is, how to connect my computer's database from my laptop? 问题是,如何从笔记本电脑连接计算机的数据库?

Specification : 规格:

I'm using this string below for my connection : 我在下面使用此字符串进行连接:

Data Source=ARVID-THEODORUS\SQLEXPRESS;Initial Catalog=DB_TRANSPORTASI;Integrated Security=True

I already setup my SQL Configuration Manager, enabled the TCP/IP, switch to the IP Addresses tab and set the IPAII Port Properties to 2301 我已经设置了我的SQL配置管理器,启用了TCP / IP,切换到IP Addresses选项卡,并将IPAII端口属性设置为2301

I turned off my firewall so I don't have to set any exception. 我关闭了防火墙,因此不必设置任何例外。

Here is the SQL Server SS : 这是SQL Server SS:

SQL Server首次连接

Question : 题 :

  1. How to connect to my computer's database from my laptop? 如何从笔记本电脑连接到计算机的数据库?

  2. Could you show me the example for my laptop VB.NET Connection String? 您能给我看看我的笔记本电脑VB.NET连接字符串的例子吗?

Thanks before. 之前谢谢。

There you go: 你去了:

"Server=192.168.1.2,1433;Initial Catalog=DB_TRANSPORTASI;Integrated Security=True"

ConnectionStrings.com is a good resource for connection strings for many different databases. ConnectionStrings.com是许多不同数据库的连接字符串的理想资源。

try this link: 试试这个链接:
http://www.linglom.com/2009/03/28/enable-remote-connection-on-sql-server-2008-express/ http://www.linglom.com/2009/03/28/enable-remote-connection-on-sql-server-2008-express/

connection string: 连接字符串:

"Network Library=DBMSSOCN; Data Source=xxx.xxx.xxx.xxx,1433;" & _
"Initial Catalog=mySQLServerDBName; User ID=myUsername;" & _
"Password=myPassword"

Try this page. 试试这个页面。 A whole list of different ways. 不同方式的完整列表。

http://www.connectionstrings.com/sql-server-2008 http://www.connectionstrings.com/sql-server-2008

确保在SQL Server配置管理器中启动“ SQL Server Browser”服务。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 替代WCF用于vb.net express中的客户端 - 服务器应用程序? - Alternative to WCF for client-server application in vb.net express? 在vb.net中设置客户端服务器的一个很好的例子? - An good examples of a client-server setup in vb.net? VB.NET应用程序中的连接字符串 - Connection String in a VB.NET Application 正确的VB.NET WinForms应用程序连接到本地SQL Server数据库的连接字符串 - Correct connection string for VB.NET WinForms application connecting to local SQL Server db Windows身份验证或VB.NET应用程序中SQL Server连接字符串的“运行方式”身份验证? - Windows Authentication or “Running As” Authentication for SQL Server Connection String in VB.NET application? 在随机系统中部署的vb.net应用程序的连接字符串 - connection string for a vb.net application to be deployed in random system 如何定义要在 VB.NET 中使用的 Sql Server 连接字符串? - How to define a Sql Server connection string to use in VB.NET? 从客户端到服务器vb.net获取真正的字符串 - get real string from client to server vb.net SQL Server 2008 Express Management Studio从LAN连接到数据库,但是使用相同的连接字符串vb.net应用程序无法连接 - SQL Server 2008 Express Management Studio connects to database from LAN but using same connection string vb.net application fails to connect 在vb.net中配置服务器与数据库的连接 - Configuring server connection with database in vb.net
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM