企业意见管理系统,入门级示例源码,适合新手
protected void btnOK1_Click(object sender, EventArgs e)
{
SqlData da = new SqlData();
SqlDataReader read = da.ExceRead("select * from tb_User where Uid='" this.txtUid.Text "'");
read.Read();
if (read.HasRows)
{
if (this.txtUid.Text == read["Uid"].ToString())//判断是否存在相同用户
{
Response.Write("<script language=javascript>alert('对不起,该用户已经注册!');location='Register.aspx'</script>");
return;
}
}
read.Close();
string cmdtxt = "INSERT INTO tb_User(Uid,Pwd,Sex,WebSite,Email,QQ,IP)";//添加用户信息
cmdtxt = " VALUES('" this.txtUid.Text "','" this.txtPwd.Text "','" this.radSex.SelectedValue "'";
cmdtxt = ",'" this.txtWebSite.Text "','" this.txtEmail.Text "','" this.txtQQ.Text "'";
cmdtxt = ",'" Request.UserHostAddress "')";
bool add = da.ExceSQL(cmdtxt);
if (add == true)
评论