日期:2014-05-16 浏览次数:20708 次
string connStr = "Data Source=LYQ-PC;Initial Catalog=zcqh;User ID=sa;Pwd=123456";
protected void Page_Load(object sender, EventArgs e)
{
if (Session ["preCustNo"]!=null)
{
//ListView lv = new ListView();
SqlConnection conn = new SqlConnection(connStr);
conn.Open();
string sql = string.Format("select * from pre_cust where pre_cust_no='{0}'", Session["preCustNo"]);
SqlCommand cmd = new SqlCommand(sql, conn);
SqlDataReader rdr = cmd.ExecuteReader();
while (rdr.Read())
{
//lv.Items.Add();
this.txtPreCustNo.Text = Session["preCustNo"].ToString();
this.txtPreCustNo.ReadOnly = true;
this.txtCustName.Text = rdr["cust_name"].ToString();
this.txtDept.Text = rdr["dept"].ToString();
this.ddlCustType.SelectedIndex = Convert.ToInt32(rdr["cust_type"]);
this.txtCompany.Text = rdr["company"].ToString();
this.txtPhone.Text = rdr["phone"].ToString();
this.txtMobile.Text = rdr["mobile"].ToString();
this.txtArea.Text = rdr["area"].ToString();
this.txtAddr.Text = rdr["addr"].ToString();
this.txtEmail.Text = rdr["email"].ToString();
&nb