当前位置: 代码迷 >> ASP.NET >> asp.net调用mysql存储过程,抛出:Only MySqlParameter objects may be stored解决方法
  详细解决方案

asp.net调用mysql存储过程,抛出:Only MySqlParameter objects may be stored解决方法

热度:8013   发布时间:2013-02-25 00:00:00.0
asp.net调用mysql存储过程,抛出:Only MySqlParameter objects may be stored
[code=C#][/code] using (MySqlConnection connection = new MySqlConnection(mysqlConnectionString))
  {
  using (MySqlCommand command = new MySqlCommand("p_getGjdata", connection))
  {
  command.Connection.Open();
  command.CommandType = CommandType.StoredProcedure;

   
  command.Parameters.Add(new MySqlParameter("?stime", MySqlDbType.VarChar).Value = "2011-11-11");
  command.Parameters.Add(new MySqlParameter("?etime", MySqlDbType.VarChar).Value = "2011-11-12");
  command.Parameters.Add(new MySqlParameter("?imsi", MySqlDbType.VarChar).Value = "460004134317878");
  DataSet ds = new DataSet();
  MySqlDataAdapter adapter = new MySqlDataAdapter(command);
  adapter.Fill(ds);



------解决方案--------------------------------------------------------
stime是时间,但是参数类型是VarChar,不知道你的存储过程中是怎么写的
  相关解决方案