紧急请教!!!
在线请教,我调试时出现提示:
过程 'adindepos' 需要参数 '@PCNumber',但未提供该参数
请高人指点一下!谢谢!
protected void Button1_Click(object sender, EventArgs e)
{
string connStr = System.Configuration.ConfigurationManager.AppSettings["ConnectionString"];
SqlConnection sqlcon = new SqlConnection(connStr);
SqlCommand Cmd = new SqlCommand();
Cmd.CommandType = CommandType.StoredProcedure;
Cmd.Connection =sqlcon;
Cmd.CommandText = "dbo.adindepos";
string PCNumber = TextBox1.Text;
string opreator = TextBox2.Text;
string inputdate = TextBox3.Text;
string order = TextBox4.Text;
string qu = TextBox5.Text;
string pr = TextBox6.Text;
string unit = DDL4.SelectedValue;
string A = DDL1.SelectedValue;
string X = "---";
string[] sArray = A.Split(X.ToCharArray(), 2);
string depository = sArray[0];
string warehousename = sArray[1];
string A1 = DDL2.SelectedValue;
string X1 = "---";
string[] sArray1 = A.Split(X1.ToCharArray(), 2);
string kindCode = sArray1[0];
string kindsName = sArray1[1];
string supply = DDL3.SelectedValue;
int unitprice = Convert.ToInt32(pr);
int quantity = Convert.ToInt32(qu);
int amount = Convert.ToInt32(qu) * Convert.ToInt32(pr);
bool Flag = false;
SqlParameter[] parms ={
new SqlParameter("@PCNumber",SqlDbType.VarChar,50),
new SqlParameter("@opreator",SqlDbType.VarChar,50),
new SqlParameter("@inputdate",SqlDbType.DateTime),
new SqlParameter("@depository",SqlDbType.VarChar,50),
new SqlParameter("@warehousename",SqlDbType.VarChar,50),
new SqlParameter("@kindCode",SqlDbType.VarChar,50),
new SqlParameter("@kindsName",SqlDbType.VarChar,50),
new SqlParameter("@unitprice",SqlDbType.VarChar,50),
new SqlParameter("@unit",SqlDbType.VarChar,50),
new SqlParameter("@quantity",SqlDbType.Int),
new SqlParameter("@amount",SqlDbType.Money),
new SqlParameter("@supply",SqlDbType.Text),
};
parms[0].Value = TextBox1.Text;
parms[1].Value = opreator;
parms[2].Value = inputdate;
parms[3].Value = depository;
parms[4].Value = warehousename;
parms[5].Value = kindCode;
parms[6].Value = kindsName;
parms[7].Value = unitprice;
parms[8].Value = unit;
parms[9].Value = quantity;
parms[10].Value = amount;
parms[11].Value = supply;
sqlcon.Open();
Cmd.ExecuteNonQuery();
sqlcon.Close();
}
ALTER PROCEDURE dbo.adindepos
(
@PCNumber varchar(50),
@opreator varchar(50),
@inputdate datetime,
@deposito