在vs.net平台用C#语言和sql ce数据库
public SqlCeConnection GetConnection()
{
string constr = @"Data Source=C:\NoteSQL\NoteSQL\MyNotes.sdf";
SqlCeConnection Con = new SqlCeConnection(constr);
return Con;
}
。
public int ExcuteScale(string sql, SqlCeParameter para)
{
SqlCeConnection Con = this.GetConnection();
SqlCeCommand Cmd = new SqlCeCommand(sql, Con);
Cmd.Parameters.Add(para);
Con.Open();《《《《=========显示错误路径找不到
int Count = (int)Cmd.ExecuteScalar();
Con.Close();
return Count;
}
我检查过了,文件夹里确实有sqlmobile.sdf数据库文件,不知道问题出在哪里!
public SqlCeConnection GetConnection()
{
string constr = @"Data Source=C:\NoteSQL\NoteSQL\MyNotes.sdf";
SqlCeConnection Con = new SqlCeConnection(constr);
return Con;
}
。
public int ExcuteScale(string sql, SqlCeParameter para)
{
SqlCeConnection Con = this.GetConnection();
SqlCeCommand Cmd = new SqlCeCommand(sql, Con);
Cmd.Parameters.Add(para);
Con.Open();《《《《=========显示错误路径找不到
int Count = (int)Cmd.ExecuteScalar();
Con.Close();
return Count;
}
我检查过了,文件夹里确实有sqlmobile.sdf数据库文件,不知道问题出在哪里!
你单步调试一下自己的程序。看看这个字符串!
我检查过了,文件夹里确实有sqlmobile.sdf数据库文件,不知道问题出在哪里!两句话不是一个文件名
http://www.mystruggle.com.cnhttp://www.mybuffet.cn