首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > Mysql >

Parameter 'table_name' not found in the collection. C#中调用MySQL存储过程出错解决方案

2012-05-24 
Parameter table_name not found in the collection. C#中调用MySQL存储过程出错C# code string connStr

Parameter 'table_name' not found in the collection. C#中调用MySQL存储过程出错

C# code
 string connStr = String.Format("server=127.0.0.1;user id=root; database=test; pooling=false;port=3306");            MySqlConnection myConn = new MySqlConnection(connStr);            myConn.Open();            MySqlCommand cmd = new MySqlCommand();            cmd.Connection = myConn;            cmd.CommandType = CommandType.StoredProcedure;            cmd.CommandText = "pre_name";            MySqlParameter ind = new MySqlParameter("?index_name", MySqlDbType.Int16, 15);            ind.Value=1;            cmd.Parameters.Add(ind);            MySqlParameter id = new MySqlParameter("?",MySqlDbType.VarChar,40);            id.Direction = ParameterDirection.Output;            cmd.Parameters.Add(id);            cmd.ExecuteNonQuery();            textBox4.Text = id.Value.ToString();            myConn.Close();

这是代码。
希望高手解决下,谢谢了!!

[解决办法]
探讨
问题解决了 :)

热点排行