protected void Page_Load(object sender, EventArgs e) { TeModel tm = new TeModel(); SqlDataReader sdr = tm.findTisaneAll(); if (sdr != null) { while (sdr.Read()) { this.tisanenum.Items.Add(new ListItem(sdr["machinename"].ToString(), sdr["id"].ToString())); } } //teid.Text = "nihao"; // testatus1.Text = "空闲"; // teroomid.Text = "1号机房"; // testatus2.Text ="良好"; int a = Convert.ToInt32(tisanenum.Value); SqlDataReader sdr1 = tm.findTisaneAllbyId(a); if (sdr1.Read()) { // teid.Text = sdr1["tisaneunitid"].ToString(); } else { tehealthstatus.Text = "无"; teroomid.Text = "无"; texiaodustatus.Text = "无"; status.Text = "无"; usingstatus.Text = "无"; } if (Request.QueryString["id"] != null) { int id = Convert.ToInt16(Request.QueryString["id"]); idnum.Value = Request.QueryString["id"].ToString(); } Bubbleinfo bi = new Bubbleinfo(); string machineid = bi.distributionmachine(); SqlDataReader sdr2 = tm.findmachinenamebyid(Convert.ToInt32(machineid)); if (sdr2.Read()) { recommend.Text = sdr2["machinename"].ToString(); } }