protected void btnagree_Click(object sender, EventArgs e)
    {
        //插入学生信息
        string name;
        string mail;
        string sex;
        string pws;
        string id;
        name=txtrealname.Text;
        mail=txtmail.Text;
        pws=txtpws.Text;
        id=txtname.Text;
        if (lst.SelectedItem.Value=="男")
        {
            sex="男";
        }
        else
        {
            sex="女";
        }
        
        OleDbConnection con = db.conCreate(Server.MapPath("zcxx.mdb"));
        con.Open();
        OleDbCommand cmd = new OleDbCommand("select count(*) from userInfo where user_ID='"+id+"'" ,con);
        int count = (int)cmd.ExecuteScalar();
        
        if (count > 0)
        {
            Label1.Text = "已经存在此名称,请换其他名称";
            con.Close();
        }
        else
        {   //string insert;
            //insert="insert into userInfo(user_ID,user_pws,user_name,pws_sex,user_E-mail)values('";
            //insert+=id+"','";
            //insert+=pws+"','";
            //insert+=name+"','";
            //insert+=sex+"','";
            //insert+=mail+"')";
            OleDbCommand cmdinsert = new OleDbCommand("Insert Into userInfo(user_ID,user_pws,user_name,user_sex,user_E-mail)Values('"+id+"','"+pws+"','"+name+"','"+sex+"','"+mail+"')",con);
            //cmdinsert.CommandText = insert;
            //cmdinsert.Connection = con;
            cmdinsert.ExecuteNonQuery();
            con.Close();        }
    }
}