ASP新手纠结中 望高人指点
就是存储过程的添加在ASP。NET里 用TEXTBOX。TEXT传数据
SqlConnection conn = new SqlConnection("Data Source=.;Initial Catalog=tushuguan;Integrated Security=True");
SqlParameter[] ps = new SqlParameter[8];
ps[0] = new SqlParameter("@UserName", SqlDbType.VarChar, 20);
ps[0] = TextBox1.Text;
ps[1] = new SqlParameter("@UserPassword", SqlDbType.VarChar, 20);
ps[1] = TextBox2.Text;
ps[2] = new SqlParameter("@UserPower", SqlDbType.VarChar, 20);
ps[2] = DropDownList1.Text;
ps[3] = new SqlParameter("@XingMing", SqlDbType.VarChar, 20);
ps[3] = TextBox4.Text;
ps[4] = new SqlParameter("@UserSex", SqlDbType.VarChar, 5);
ps[4] = RadioButtonList1.SelectedValue;
ps[5] = new SqlParameter("@UserDepart", SqlDbType.VarChar, 50);
ps[5] = TextBox5.Text;
ps[6] = new SqlParameter("@UserTel", SqlDbType.VarChar, 20);
ps[6] = TextBox6.Text;
ps[7] = new SqlParameter("@UserEmail", SqlDbType.VarChar, 30);
ps[7] = TextBox7.Text;
SqlCommand comm = new SqlCommand("AddProc_Users", conn);
= CommandType.StoredProcedure;
conn.Open();
comm.ExecuteNonQuery();
conn.Close();
Label2.Text = "添加成功";
无法将类型“string”隐式转换为“System.Data.SqlClient.SqlParameter”
每个数组赋值都有这错 一共有8个
纠结 纠死