标题:添加用户
只看楼主
yxhrgyj
Rank: 1
等 级:新手上路
帖 子:22
专家分:0
注 册:2012-2-5
结帖率:100%
已结贴  问题点数:10 回复次数:1 
添加用户
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>");
            }
        }


求解为什么添加了后,数据库中没反应
搜索更多相关主题的帖子: void 用户 
2012-04-17 08:53
yms123
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
得分:10 
你那个数据库的截图是,表结构图,不是数据截图,要看数据点击表鼠标右键选择打开表
2012-04-19 14:43



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-365974-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.282149 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved