将数据库文件添加到sqlexpress的问题 [英] problem in adding database files to sqlexpress

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

问题描述

朋友们,



我开发了一个C#和sqlserver 2008程序。我想在客户的计算机上使用它。首先,我在客户计算机上安装了sqlexpress。然后我添加数据库文件到程序directiry但它不起作用。我可以更正此探测器。



当我想登录时出现错误消息它说的程序:



hi friends,

i developed a C# and sqlserver 2008 program. and i want to use it in customer computer.first of all i installed sqlexpress in customer computer. then i added database files to program directiry but it does not work.how can i correct this probem.

there is a error message that appear when i want to log into program that it says:

a network-related or instance-specific error occured while establishing a connection to sqlserve. the server was not found or was not
accessible. verify that the instance name is correct and that sql server is configured to allow remote connections.
(provider:named pipes provider,error:40 - could not open a connection to sql server)

推荐答案

解决错误40:



通过这个



http://blog.sqlauthority.com/2007/04/23/sql-server-fix- error-40-could-not-open-a-connection-to-sql-server / [ ^ ]



http ://stackoverflow.com/questions/20282676/sql-server-2008-r2-giving-named-provider-error-40-sql-error-2 [ ^ ]
Resolve Error 40:

Go through this

http://blog.sqlauthority.com/2007/04/23/sql-server-fix-error-40-could-not-open-a-connection-to-sql-server/[^]

http://stackoverflow.com/questions/20282676/sql-server-2008-r2-giving-named-provider-error-40-sql-error-2[^]


...我添加了数据库文件到程序directiry但它不起作用。我可以纠正这个探测...



您需要将数据库文件直接移动到 SQL Server数据文件夹 [ ^ ],然后附上此文件 [ ^ ] 进入MS SQL Server实例 [ ^ ]。



之后正确配置连接字符串 [ ^ ]到这个命名实例。
...i added database files to program directiry but it does not work.how can i correct this probem...

You need to move database files directly into SQL Server Data folder[^], then to attach this file[^] into MS SQL Server instance[^].

After that properly configure connection string[^] to this named instance.


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

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