添加用户
protected void BtnSave_Click(object sender, EventArgs e){
try
{
bm_user_info.USER_ADD = "n";
bm_user_info.USER_EXAMINE ="n";
bm_user_info.USER_NAME = TxtUid.Text;
bm_user_info.TRUE_NAME = TxtName.Text;
bm_user_info.USER_PASSWORD = TxtPwd.Text;
bm_user_info.LOGIN_TIME = DateTime.Now.ToShortDateString();
bm_user_info.USER_STATE = "";
bm_user_info.USER_DETIAL = "";
bm_user_info.USER_OTHER = "";
List<BM_USER_INFO> lists = bm_user_infoManager.GetModelList("USER_NAME='" + bm_user_info.USER_NAME + "'");
if (lists.Count > 0)
{
Response.Write("<script>alert('用户名已存在!')</script>");
}
else
{
bm_user_infoManager.Add(bm_user_info);
Response.Write("<script>alert('添加成功')</script>");
}
}
catch(Exception ex)
{
Response.Write("<script>alert('错误原因:" + ex.Message + "')</script>");
}
}
求解为什么添加了后,数据库中没反应