System.Data.SqlClient.SqlCommand myCommand;
int moneyamount=Convert.ToInt32(this.number.Text.ToString());//要把字符形转为数字作为参数给changemoney,这样对吗?
string sqlStr="exec changemoney @moneyamount,@result)";
myCommand=new System.Data.SqlClient.SqlCommand(sqlStr,Myconn);
SqlParameter SqlParm = myCommand.Parameters.Add("result", SqlDbType.Char);
SqlParm.Direction = ParameterDirection.ReturnValue;
myCommand.CommandType=CommandType.StoredProcedure;
myCommand.ExecuteReader();
Myconn.Close();
this.changemoney.Text=myCommand.Parameters["result"].Value.ToString();
int moneyamount=Convert.ToInt32(this.number.Text.ToString());//要把字符形转为数字作为参数给changemoney,这样对吗?
string sqlStr="exec changemoney @moneyamount,@result)";
myCommand=new System.Data.SqlClient.SqlCommand(sqlStr,Myconn);
SqlParameter SqlParm = myCommand.Parameters.Add("result", SqlDbType.Char);
SqlParm.Direction = ParameterDirection.ReturnValue;
myCommand.CommandType=CommandType.StoredProcedure;
myCommand.ExecuteReader();
Myconn.Close();
this.changemoney.Text=myCommand.Parameters["result"].Value.ToString();
现在问题只剩下:int moneyamount=Convert.ToInt32(this.number.Text.ToString());
怎么把这个int moneyamount参数给changemoney?
myCommand.CommandText="changemoney";
提示缺少@money参数