private void BindData(string begin, string end) { string sql = string.Format(_sqlPattern, begin, end); DataTable dt = WholeWebConfig.GetDrvIDataAccessDecode().SelectDataTable(sql, "tmp"); if (dt != null) { this.DataGrid1.DataSource = dt; this.DataGrid1.DataBind(); } }
protected void btnSearch_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtCode.Text)) { return; } string sql = string.Format(sqlPattern, txtCode.Text); DataTable dt = WholeWebConfig.GetDrvIDataAccessDecode().SelectDataTable(sql, "tmp"); if (dt != null) { this.DataGrid1.DataSource = dt; this.DataGrid1.DataBind(); } }
protected void cbLxzsxzqhValue_SelectedIndexChanged(object sender, EventArgs e) { if (string.IsNullOrEmpty(cbLxzsxzqhValue.SelectedValue)) { txtLxzsxxdz.Text = "广东省"; return; } string sql = string.Format(sqlPattern, cbLxzsxzqhValue.SelectedValue); DataTable dt = WholeWebConfig.GetDrvIDataAccessDecode().SelectDataTable(sql, "tmp"); if (dt == null) { return; } try { string sf = dt.Rows[0]["sf"].ToString(); string cs = dt.Rows[0]["cs"].ToString(); string dmsm1 = dt.Rows[0]["dmsm1"].ToString(); txtLxzsxxdz.Text = string.Format("{0}{1}{2}", sf, cs, dmsm1); } catch (Exception ex) { } }