📄 页面中传值到另一个页面上的控件).txt
字号:
private void modifycount()//从前面选择数据源进行更改的函数
{
SqlConnection con = db.creatcon();
con.Open();
SqlCommand cmd = new SqlCommand("select * from contract where tid=@tid", con);
cmd.Parameters.Add("@tid", SqlDbType.VarChar);
cmd.Parameters["@tid"].Value = Request.QueryString["Tid"].ToString(); //传过来的TID用于查找对应相
SqlDataReader sdr = cmd.ExecuteReader();
if (sdr.Read())//若存在对应相
{
this.Label1.Text = sdr["Tid"].ToString();
this.Label2.Text = sdr["tcid"].ToString();
// this.DropDownList1.Items.FindByValue(sdr["tpid"].ToString()).Selected = true;
this.txtbegintime.Text = sdr["tbegintime"].ToString();
this.txtendtime.Text = sdr["tendtime"].ToString();
this.txttotalmoney.Text = sdr["ttotamoney"].ToString();
this.txtgetmoney.Text = sdr["treadymoney"].ToString();
this.DropDownList2.Items.FindByValue(sdr["tstate"].ToString()).Selected = true;
this.txttcount.Text = sdr["tcontent"].ToString();
con.Close();
}
else
{
Response.Write("<script language='javascript'>alert('对不起没有该合同信息')</script>");
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -