Sql CE连接无法打开。 [英] Sql CE Connections will not open.

查看:60
本文介绍了Sql CE连接无法打开。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

建立与SQL Server的连接时发生与网络相关或特定于实例的错误。服务器未找到或无法访问。验证实例名称是否正确,以及SQL Server是否配置为允许远程连接。 (提供者:SQL网络接口,错误:26 - 查找指定的服务器/实例时出错)



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)

using (SqlConnection conn = new SqlConnection(@"Data Source=|DataDirectory|\LotusDat.sdf")) 
{
    conn.Open();
}







在确定如何连接到SQL CE 4.0数据库时遇到问题。我已经尝试添加对SqlCeConnection的引用,而不是使用正常的SqlConnection数据字符串,但似乎无法找到它的程序集。有什么建议吗?




Having problems figuring out how to connect to a SQL CE 4.0 database. I have tried adding a reference to SqlCeConnection instead of using the normal SqlConnection Data string, but cannot seem to find the assembly for that either. Any suggestions?

推荐答案

你不使用SQL连接来连接到SQLCE数据库 - 你使用 SqlCeConnection [ ^ ]和相应的SqlCeCommand等。
You don't use an SQLconnection to connect to an SQLCE database - you use an SqlCeConnection[^] and the appropriate SqlCeCommand, etc..


这篇关于Sql CE连接无法打开。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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