无法从 .NET 3.5 连接到 SQL Server 2008
我安装了 SQL Server 2008 Management Studio,并卸载了 2005,因此使用本地 SQL Server Express 的 .net 应用程序不再工作。我在 App_Data 文件夹中尝试使用 nothwind 2008 示例。连接字符串是:
Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\NORTHWND.MDF;Integrated Security=True;User Instance=True
当我尝试连接到文件并测试连接时,出现以下错误:
与网络相关或特定于实例的 建立时发生错误 连接到 SQL Server。服务器 未找到或无法访问。 验证实例名称是否为 正确并且 SQL Server 是 配置为允许远程 连接。 (提供商:SQL 网络 接口,错误:26 - 错误定位 指定服务器/实例)
我验证了文件的安全设置并让每个人都完全控制。我应该更新什么设置才能打开2008版本。任何帮助将不胜感激。
I installed SQL Server 2008 Management Studio, and uninstalled 2005 as a consequence my .net application with a local SQL Server express doesn’t work anymore. I tried with nothwind 2008 sample at my App_Data folder. The connection string is :
Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\NORTHWND.MDF;Integrated Security=True;User Instance=True
When I try to connect to the file and testing the connection I get the following error:
A network-related or instance-specific
error occurred while establishing a
connection to SQL Server. 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: SQL Network
Interfaces, error: 26 - Error Locating
Server/Instance Specified)
I verified the security setting of the file and put everyone full control. What setting should I update in order to be able to open 2008 version. Any help would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
1) 转到
开始 ->微软 SQL Server 2008 ->配置工具-> SQL Server 配置管理器
检查所有服务是否正在运行。如果没有,请启动它们。如果是,请尝试重新启动一次。
看看它是否有效。
1) Go to
Start -> Microsoft SQL Server 2008 -> Configuration Tools -> SQL Server Configuration Manager
Check whether all the services are running or not. If not, start them. If yes, try to restart them once.
And see if it works.
听起来好像当您卸载 2005 时,您就卸载了所有内容,包括 SQL 2005 的数据库引擎。如果您想要 SQL 2008,您可以使用 Web Platform Installer 进行安装: http://www.microsoft.com/web/
It sounds like when you uninstalled 2005, you uninstalled everything, including the database engine for SQL 2005. If you want SQL 2008, you can install that using the Web Platform Installer: http://www.microsoft.com/web/
检查您的服务以确保 SQL Server 实例正在运行。
编辑
我正在尝试解决这个问题。
您的服务下是否列出了 SQL Server 服务?运行...services.msc 或通过控制面板导航。我相信在您卸载/安装过程中出现了问题,您需要重新安装。
Check your services to ensure the SQL server instance is running.
Edit
I'm trying to get a handle on the issue.
Do you have a SQL Server Service listed under services? Run...services.msc or navigate via control panel. I believe during your uninstall/install something went awry and you will need to reinstall.