string strsql = "insert into register (username,password,sex,picture,IM,information,others,ifisuser) values ('" + TextBox1.Text + "','" + TextBox2.Text + "','" + DropDownList1.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "','" + TextBox5.Text + "','" + TextBox6.Text + "',1)";
SQLHelper.SQLHelper.ExecNonQuery(strsql);
using (SqlConnection con = new SqlConnection(condb))
{
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandText = sqlcmd;
if (paraList != null)
{
cmd.CommandType = CommandType.Text;
foreach (SqlParameter para in paraList)
{ cmd.Parameters.Add(para); }
}
con.Open();
cmd.ExecuteNonQuery();
}这段代码用于注册,但数组得到的值一直为零,有什么问题么?
SQLHelper.SQLHelper.ExecNonQuery(strsql);
using (SqlConnection con = new SqlConnection(condb))
{
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandText = sqlcmd;
if (paraList != null)
{
cmd.CommandType = CommandType.Text;
foreach (SqlParameter para in paraList)
{ cmd.Parameters.Add(para); }
}
con.Open();
cmd.ExecuteNonQuery();
}这段代码用于注册,但数组得到的值一直为零,有什么问题么?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货