updata.aspx.cs

(完整代码) 1KB

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class updata : System.Web.UI.Page
{
    protected DataModule DM = new DataModule();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["section1"].ToString() == "House")
            {
                string sql = "select * from house where houserID=" + Convert.ToInt32(Session["section2"].ToString());
                DM.QueryDataSet(sql, "table1");
                t1.Text = DM.DataSetobj.Tables["table1"].Rows[0][0].ToString();
                t2.Text = DM.DataSetobj.Tables["table1"].Rows[0][1].ToString();
                t3.Text = DM.DataSetobj.Tables["table1"].Rows[0][2].ToString();
                t4.Text = DM.DataSetobj.Tables["table1"].Rows[0][3].ToString();
                t5.Text = DM.DataSetobj.Tables["table1"].Rows[0][4].ToString();
                t6.Text = DM.DataSetobj.Tables["table1"].Rows[0][5].ToString();
                t7.Text = DM.DataSetobj.Tables["table1"].Rows[0][6].ToString();
            }
        }
    }
    protected void reset_Click(object sender, EventArgs e)
    {
        t1.Text = "";
        t2.Text = "";
        t3.Text = "";
        t4.Text = "";
        t5.Text = "";
        t6.Text = "";
        t7.Text = "";
    }
    protected void up_Click(object sender, EventArgs e)
    {
        string sql = "update House set HouserID=" + Convert.ToInt32(t1.Text.Trim())+",peopleName='"+t2.Text.Trim()+"',phoneNumber='"+t3.Text.Trim()+"',houseAcreage='"+t4.Text.Trim()+"',houseStructure='"+t5.Text.Trim()+"',type='"+t6.Text.Trim()+"',groupID="+Convert.ToInt32(t7.Text.Trim())+"where houserID="+Convert.ToInt32(Session["section2"].ToString());
        DM.ExecutSql(sql);
    }
}

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。