SQL错误

问题描述:

我正在开发一个客户端应用程序,并在Visual Studio 2010中使用sql本地数据库"SQL Server Compact 3.5",当我通过一个选择查询来检索用户名和密码时,它给出了此错误

建立与SQL Server的连接时发生了与网络相关或特定于实例的错误.找不到服务器或无法访问该服务器.请验证实例名称正确且SQL Server已配置为允许远程连接.(提供者: SQL网络接口,错误:26-错误指定服务器/实例的位置)"

i am developing a client side application and use a sql local database"SQL Server Compact 3.5" in visual studio 2010 when i pass a select query for retrieve username and password it give this 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)"

您的代码是什么样的?您是直接通过VS创建数据库连接吗? (例如,将其添加为资源)
What does your code look like? Are you creating the database connection directly through VS? (eg adding it as a resource)


您需要在此处发布一些代码,然后其他人才能帮助您.
You need to post some code here before someone can help you.


在继续之前,如果它MS SQL Server,请确保"SQL Server Browser"服务正在服务器上运行,另外请确保您可以使用Management Studio连接到服务器.检查您的防火墙!否则,请发布您的代码!
Before you continue, if its a MS SQL server, make sure that the "SQL Server Browser" service is running on the Server, plus make sure you can connect to the server using Management Studio. Check your firewalls! Otherwise its your code, post it!