日期:2014-05-16  浏览次数:21101 次

Input string was not in a correct format.
CREATE DEFINER=`crm`@`%` PROCEDURE `pre_delDataByTbName`(
in_table VARCHAR(128),
in_column VARCHAR(128),
in_new_value VARCHAR(10),
in_where VARCHAR(40)
)
BEGIN
  DECLARE l_sql VARCHAR(400);
  SET l_sql= CONCAT(' ',
  'DELETE FROM ',in_table,
  ' WHERE',in_where);
  SET @sql=l_sql;
  PREPARE s1 FROM @sql;
  EXECUTE s1;
  DEALLOCATE PREPARE s1;
END;


C#的调用的参数:


  MySqlParameter[] mySqlParameter = new MySqlParameter[4];

  mySqlParameter[0] = new MySqlParameter("in_table", SqlDbType.VarChar);
  mySqlParameter[0].Value = "t1";

  mySqlParameter[1] = new MySqlParameter("in_column", SqlDbType.VarChar);
  mySqlParameter[1].Value = "ss";

  mySqlParameter[2] = new MySqlParameter("in_new_value", SqlDbType.VarChar);
  mySqlParameter[2].Value = "dd";

  mySqlParameter[3] = new MySqlParameter("in_where", SqlDbType.VarChar);
  mySqlParameter[3].Value = " tID=123";

不知道为什么报:Input string was not in a correct format.

------解决方案--------------------
存储过程执行有问题吗?如没有问题c#调用存储过程中有问题。
------解决方案--------------------
在mysql客户端执行下call pre_delDataByTbName看看