标题:哪出错了,修改不过来...?
只看楼主
swalia
Rank: 1
等 级:新手上路
帖 子:108
专家分:0
注 册:2006-4-16
 问题点数:0 回复次数:1 
哪出错了,修改不过来...?
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        SqlConnection strcon = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["strcon"]);
        strcon.Open();
        string Phone = this.Phone.Text.ToString();
        string UserName = this.UserName.Text.ToString();
        string Sex = this.Sex.Text.ToString();
        string Tel = this.Tel.Text.ToString();
        string CidType = this.CidType.Text.ToString();
        string Cid = this.Cid.Text.ToString();
        string Zip = this.Zip.Text.ToString();
        string Addess = this.addess.Text.ToString();
        SqlCommand scd = new SqlCommand("update tb_User set Phone='" + Phone + "',UserName='" + UserName + "',Sex='" + Sex + "',Tel='" + Tel + "',CidType='" + CidType + "',Cid='" + Cid + "',Zip='" + Zip + "',Addess='" + Addess + "' where Userid='" + Session["Userid"].ToString() + "'", strcon);
        scd.ExecuteNonQuery();
        Response.Write("<script lanuage=javascript>alert('修改成功!');location='../Member/ManageMember.aspx'</script>");
    }
提交后原数据没办法修改过来.
搜索更多相关主题的帖子: string ToString Text Phone UserName 
2008-04-09 23:13
残影留香
Rank: 1
来 自:广西南宁
等 级:新手上路
帖 子:193
专家分:0
注 册:2008-3-19
得分:0 
"update tb_User set Phone='" + Phone + "',UserName='" + UserName + "',Sex='" + Sex + "',Tel='" + Tel + "',CidType='" + CidType + "',Cid='" + Cid + "',Zip='" + Zip + "',Addess='" + Addess + "' where Userid=" + Userid

这样试一下!

[[it] 本帖最后由 残影留香 于 2008-4-12 11:23 编辑 [/it]]
2008-04-12 11:20



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




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

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