连接到本地网络上的SQL Server [英] Connecting to SQL Server on local Network

查看:124
本文介绍了连接到本地网络上的SQL Server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用SQL Server 2012 Express& VB.Net



在我的开发机器上,一切都很完美,SQL Server 2012 LocalDB作为数据源



Localdb连接字符串:

I'm Using SQL Server 2012 Express & VB.Net

On my development machine everything is perfect with with SQL Server 2012 LocalDB as data source

Localdb Connection String:

"Data Source=(LocalDB)\v11.0;Integrated Security=true;AttachDbFileName=C:\TestData\Test.Mdf"





在使用SQL Server 2012 Express的测试机器上,所有内容都在同一台PC上运行完美安装了哪个SQL Server



SQL Server Express连接字符串。

1。附加数据库文件



On the testing machine with SQL Server 2012 Express everything went perfectly on same pc on which SQL Server was installed

SQL Server Express Connection String.
1. Attach DB File

'For Connection
"Server=.\SQLEXPRESS;Initial Catalog=Master;Trusted_Connection=Yes;"
'For Attaching DB File to above Connection
"exec sp_attach_db @dbname='Test', @filename1='C:\TestData\Test.Mdf', @filename2='C:\TestData\Test.ldf'"





2。已连接到数据库文件



2. Connect to DB File Attached Already

"Server=.\SQLEXPRESS;Integrated Security=true;Database=Test"



一切都与上面的细节完美结合。

现在我从另一台PC连接它给了我一个错误


Everything went perfectly with above details.
Now I connect from another PC and it gave me an error

Invalid Username & Password



我该怎么办?



请帮助


What should I do?

Please help

推荐答案

提供正确的用户名和密码。

通常,开发机器使用Integrated Security = True,因为该实例对于正在测试的应用程序是本地的:对于生产数据库系统,即不那么正常,因为你需要限制谁可以对哪个数据库做什么:你不希望每个人都能访问敏感信息,例如地址列表,因为大多数公司都有法律限制这些信息的可用性(在英国,它被称为数据保护法案。



因此,您需要与管理您的生产数据库服务器的人交谈,并从中获取适当的用户名和密码他 - 你可以在你的申请中使用它。
Provide the correct username and password.
Normally, development machines use "Integrated Security=True" because the instance is local to the app being tested: for production DB systems, that is a lot less normal because you need to restrict who can do what to which database: You don't want everybody having access to sensitive information such as address lists for example, because there are legal restrictions in most companies on how available such info is (in the UK it's called the Data Protection Act).

So you need to talk to whoever administers your production DB server, and get a "proper" username and password from him - which you can then use in your application.


这篇关于连接到本地网络上的SQL Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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