当前位置: 代码迷 >> .NET新技术 >> 报错:You have an error in your SQL syntax; check the manual .该如何解决
  详细解决方案

报错:You have an error in your SQL syntax; check the manual .该如何解决

热度:134   发布时间:2016-04-25 01:52:15.0
报错:You have an error in your SQL syntax; check the manual .....
报错:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'xx' at line 1 
xx是存储过程名字 
存储过程
create procedure xx
begin
select bb from test;
end;

C# 业务层: 
  public DataSet testa() 
  { 
  DataBase db = new DataBase(); 
  return db.GetDataSet("xx"); 
  } 
数据层: 
  public DataSet GetDataSet(String ProcName) 
  { 
  Open(); 
  MySqlDataAdapter adapter = new MySqlDataAdapter(ProcName, conn); 
  DataSet ds = new DataSet(); 
  adapter.Fill(ds); 
  Close(); 
  return ds; 
  }

各位帮帮我啊 急用啊

------解决方案--------------------
create procedure xx 
AS
begin 
select bb from test; 
end;
------解决方案--------------------
adapter.SelectCommand.CommandType = CommandType.StoredProcedure;
你不指定,谁知道是存储过程啊?
  相关解决方案