protected void BtnUpdate_Click(object sender, EventArgs e)
{
string str = "update Customer set cCusName='" + cCusName.Text + "',cCusAbbName='" + cCusAbbName.Text + "',cCusPerson='" + cCusAbbName.Text + "',sex='" + DDLsex.SelectedItem.Text + "',cCusAddress='" + address.Text + "',";
str = str + "cCusOAddress='" + address.Text + "',cCusPostCode='" + yb.Text + "',cCusPhone='" + phone.Text + "',cCusFax='" + cz.Text + "',cCCCode='02',cCusHand='" + sj.Text + "',cCusMemo='" + bz.Text + "' where cCusCode='" + Session["userId"].ToString() + "'";
str+= "\n insert into Cus_Address (cCusCode,cCusPerson,cCusPhone,cCusHand,cCusPostCode,cCusAddress,cCusDef) values";
str+= "('" + Session["userId"].ToString() + "','" + cCusAbbName.Text + "','" + phone.Text + "','" + sj.Text + "','" + yb.Text + "','" + address.Text + "','1')";
Response.Write (str);
Response.End;
dal.ExecuteSqlTest(str, ""); if (dal.ExecuteSql(str))
{
first.Visible = false;
second.Visible = false;
third.Visible = false;
finish.Visible = true;
Session["userId"] = null;
}
else
{
Common.AlertMessage("添加详细信息出错!");
return;
} }
中的str怎么输出啊!
{
string str = "update Customer set cCusName='" + cCusName.Text + "',cCusAbbName='" + cCusAbbName.Text + "',cCusPerson='" + cCusAbbName.Text + "',sex='" + DDLsex.SelectedItem.Text + "',cCusAddress='" + address.Text + "',";
str = str + "cCusOAddress='" + address.Text + "',cCusPostCode='" + yb.Text + "',cCusPhone='" + phone.Text + "',cCusFax='" + cz.Text + "',cCCCode='02',cCusHand='" + sj.Text + "',cCusMemo='" + bz.Text + "' where cCusCode='" + Session["userId"].ToString() + "'";
str+= "\n insert into Cus_Address (cCusCode,cCusPerson,cCusPhone,cCusHand,cCusPostCode,cCusAddress,cCusDef) values";
str+= "('" + Session["userId"].ToString() + "','" + cCusAbbName.Text + "','" + phone.Text + "','" + sj.Text + "','" + yb.Text + "','" + address.Text + "','1')";
Response.Write (str);
Response.End;
dal.ExecuteSqlTest(str, ""); if (dal.ExecuteSql(str))
{
first.Visible = false;
second.Visible = false;
third.Visible = false;
finish.Visible = true;
Session["userId"] = null;
}
else
{
Common.AlertMessage("添加详细信息出错!");
return;
} }
中的str怎么输出啊!
Common.AlertMessage("添加详细信息出错!");
response.write("<script>alert('" + @str + "')</script>");
return;
看了以下你的代码:发现了错误str+= "( '" + Session["userId"].ToString() + " ', //双引号里还包含双引号,肯定错了噻.LZ仔细检查其他的地方哦!