windows ce连接数据库时,总是提示未知错误
private SqlCeConnection con=null;string constr = "Data Source=MyDatabase#1.sdf;password=test;encrypt database=TRUE";
/// <summary>
/// /////得到数据库连接方法
/// </summary>
/// <returns></returns>
internal SqlCeConnection GetConnection()
{
if (con == null)
{
con = new SqlCeConnection(constr);
try
{
con.Open();
}
catch (SqlCeException ex)
{
throw ex;
}
}
else if (con.State == ConnectionState.Closed || con.State == ConnectionState.Broken)
{
con.Open();
}
return con;
}
运行至open时提示未知错误! --------------------编程问答-------------------- http://download.csdn.net/detail/liyu1128/3009185 --------------------编程问答-------------------- Unspecified error [ Test.sdf ] --------------------编程问答-------------------- 表示一下疑问,有密码连接?没试过,也没看到sqlce下可以建立带密码的.sdf数据库
--------------------编程问答-------------------- 到没遇到过 很少用SQLCE了 用SQLLITE多些
补充:移动开发 , Windows Phone