经验:SQL Server Compact 出现的错误解决方法. There was an error parsing the query
2009-11-12 15:44
746 查看
调试SQL Server Compact3.51 SP1数据库程序,当调试到
StringBuilder strSql=new StringBuilder();
strSql.Append("SELECT TOP 1 Q_ID,Q_Name,Q_Unit,Q_Default,SectorNo,StartPos,DataSize FROM QualityIndex ");
strSql.Append("WHERE Q_Name=@Q_Name ");
SqlCeParameter[] parameters = {
new SqlCeParameter("@Q_Name", SqlDbType.NVarChar,48)};
parameters[0].Value = Q_Name;
using (SqlCeConnection connection = new SqlCeConnection(connectionString))
{
SqlCeCommand cmd = new SqlCeCommand();
PrepareCommand(cmd, connection, null, strSql.ToString(), parameters);
SqlCeDataAdapter da = new SqlCeDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds, "ds2"); //出现错误 There was an error parsing the query
,不知道为什么?后来将TOP 1去掉就不出现错误了,不知道这是为什么?各位老大哪位又遇到过?还有一个修改的地方预先的SQL 都是小写改为大写。
cmd.Parameters.Clear();
return ds;
}
StringBuilder strSql=new StringBuilder();
strSql.Append("SELECT TOP 1 Q_ID,Q_Name,Q_Unit,Q_Default,SectorNo,StartPos,DataSize FROM QualityIndex ");
strSql.Append("WHERE Q_Name=@Q_Name ");
SqlCeParameter[] parameters = {
new SqlCeParameter("@Q_Name", SqlDbType.NVarChar,48)};
parameters[0].Value = Q_Name;
using (SqlCeConnection connection = new SqlCeConnection(connectionString))
{
SqlCeCommand cmd = new SqlCeCommand();
PrepareCommand(cmd, connection, null, strSql.ToString(), parameters);
SqlCeDataAdapter da = new SqlCeDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds, "ds2"); //出现错误 There was an error parsing the query
,不知道为什么?后来将TOP 1去掉就不出现错误了,不知道这是为什么?各位老大哪位又遇到过?还有一个修改的地方预先的SQL 都是小写改为大写。
cmd.Parameters.Clear();
return ds;
}
相关文章推荐
- 解决IIS7中出现An error occurred on the server when processing the URL错误提示的方法
- 解决IIS7中出现An error occurred on the server when processing the URL错误提示的方法
- 解决IIS7中出现An error occurred on the server when processing the URL错误提示的方法
- 解决IIS7中出现An error occurred on the server when processing the URL错误提示的方法
- 解决IIS7中出现An error occurred on the server when processing the URL错误提示的方法
- [Asp]解决IIS7中出现An error occurred on the server when processing the URL错误提示的方法
- 解决IIS7中出现An error occurred on the server when processing the URL错误提示的方法
- 解决IIS7中出现An error occurred on the server when processing the URL错误提示的方法
- Xcode真机调试中"There was an internal API error"错误解决方法
- 运行rails server 出现There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireErr
- magento 安装时出现 There has been an error processing your request 错误解决方法
- 创建存储过程错误(已解决):Error Code : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server ver
- "There was an internal API error"错误解决方法
- Xcode 真机调试中"There was an internal API error"错误解决方法
- Xcode真机调试中"There was an internal API error"错误解决方法;
- windows上zend server安装 报The server encountered an internal error or misconfiguration and was unable to complete your request -解决方法 摘自网络
- Xcode真机调试中"There was an internal API error"错误解决方法
- Xcode 真机调试中"There was an internal API error"错误解决方法
- 解决Windows server 2012 R2 系统使用IIS8浏览Asp程序出现"An error occurred on the server when processing the URL"错误