sql server数据库文件 [英] sql server database file

查看:93
本文介绍了sql server数据库文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

已将数据库文件添加到vs 2013中构建的vb.net项目(Windows 8.1),当我发布时,本地工作正常,但通过cd部署到客户端机器,运行Windows 7系统无法找到数据库。有人有主意吗?感谢大家的快速回复,再次运行它。



使用带有Windows 7家庭高级版的借来的机器。这台机器需要密码才能打开,我有。 2个错误消息,第一个读取Connection Timeout Expired。尝试使用登录前握手确认时超时时间已过。这可能是因为登录前握手失败或服务器无法及时响应。尝试连接到此服务器时花费的持续时间是 - [¨预登录]初始化= 32899;握手= 530,



我在消息框中按确定并打开程序精细的第二个错误是无法打开数据库#####登录请求。登录失败。用户登录失败'#### - ## \ ### ##'。所以我认为问题在于握手超时?究竟是什么?

Have added a database file to a vb.net project built in vs 2013(Windows 8.1),when i publish,works fine locally, but deploy to clients machine via cd, running windows 7 system cannot find database. anyone have any ideas? Thanks for the quick responses from everyone, just ran it again.

Am using a borrowed machine with the windows 7 home premium .This machine needs password to open, which I have. 2 error messages, first one reads Connection Timeout Expired. The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement. This could be because the pre-login handshake failed or the server was unable to respond back in time. The duration spent while attempting to connect to this server was -[¨Pre-Login] initialization=32899;handshake=530,

I press ok in messagebox and program opens fine second error is "Cannot open database "#####" requested by the login. The login failed.Login failed for user'####-##\### ##'." So I assume problem is with this handshake time out? and what exactly is it?

推荐答案

您的问题是您没有在客户端计算机上安装SQL Server Express LocalDB。从Visual Studio 2013开始,默认数据库服务器是一个称为SQL Server Express LocalDB的轻量级数据库引擎(取代了SQL Server Compact)。



您的应用程序正在尝试连接到开发计算机上指定的LocalDB实例。当您将其发布为从CD运行时,您需要添加一个配置转换,用一个正确的服务器和实例名称替换连接字符串。



这会添加一个您的应用程序的复杂性,您需要确保安装了SQL Server LocalDB,如果您使用的是ClickOnce部署,则不会在安装程序中内置它来验证这一点。



此链接包含有关SQL Server Express LocalDB的详细信息:

SQL Server 2014 Express LocalDB [ ^ ]
Your issue is you do not have SQL Server Express LocalDB installed on the client machine. Starting with Visual Studio 2013, the default database server is a light weight database engine called SQL Server Express LocalDB (which replaced SQL Server Compact).

Your application is attempting to connect to the LocalDB instance named on your development computer. When you publish it to run from a CD, you need to add a configuration transformation that replaces the connection string with the correct server and instance name.

This does add a complexity to your application, you need to ensure you have SQL Server LocalDB installed and if you are using the ClickOnce deployment, it isn't built into the installer to validate this.

This link has details on SQL Server Express LocalDB:
SQL Server 2014 Express LocalDB[^]


客户端必须安装MS SQL Server 2012。然后你需要附加数据库 [ ^ ]以便能够使用它。不要忘记更改连接字符串!
Client have to have MS SQL server 2012 installed. Then you need to attach database[^] to be able to use it. Do not forget to change connection string!


这篇关于sql server数据库文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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