SDF数据库select报错问题
vs2008SP1编译的问题调用sdf数据库,在mobile设备能打开数据库,能够正常insert数据
但是在select 列 from 表,时候就报错,异常信息为空,select 1 from 表能够正常使用,不知道哪里错误,急求。
try
{
var aa = System.IO.Path.Combine(SysSetting.Instance.WorkFolder, "ADPzx.sdf");
aa = aa.Replace(@"file:\", "");
sqlcecon = new SqlCeConnection("Data Source=" + aa);
//sqlcecon = new SqlCeConnection("Data Source=C:\\Documents and Settings\\Administrator\\桌面\\SQ-PDA2\\SQ-LIB2\\ADPzx.sdf");
sqlcecon.Open();
string vssql = "SELECT F_XH FROM LJXZ ";
SqlCeDataAdapter adptrodbc = new SqlCeDataAdapter(vssql, sqlcecon);
adptrodbc.Fill(dt);
}
catch (SystemException ee)
{
// 获取到的异常信息如下:
// "The database file cannot be found. Check the path to the database. [,,,File name,,]"
MessageBox.Show("ee" + ee.Message);
}