protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { OdbcCommand cmda = conn_asset.CreateCommand(); cmda.CommandText = " select * from master_spare_entry order by description asc"; OdbcDataAdapter da1 = new OdbcDataAdapter(cmda); DataTable dt1 = new DataTable(); da1.Fill(dt1); Drp_1.DataSource = dt1; Drp_1.DataTextField = "description"; Drp_1.DataValueField = "ID"; Drp_1.DataBind(); OdbcCommand cmdc = conn_asset.CreateCommand(); cmdc.CommandText = " select * from amclogin"; OdbcDataAdapter da3 = new OdbcDataAdapter(cmdc); DataTable dt3 = new DataTable(); dt3.Clear(); da3.Fill(dt3); Drp_3.DataSource = dt3; Drp_3.DataTextField = "name"; Drp_3.DataValueField = "user_id"; Drp_3.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { string p_no; p_no = Session["systems"].ToString(); if (!Page.IsPostBack) { Drp_1.Visible = true; lbl_error.Visible = false; OdbcCommand cmda = conn_asset.CreateCommand(); cmda.CommandText = "select * from master_spare_entry "; OdbcDataAdapter da = new OdbcDataAdapter(cmda); DataTable dt = new DataTable(); da.Fill(dt); dt.Columns.Add(new DataColumn("Content", System.Type.GetType("System.String"), "ID + ' - ' + description")); Drp_1.DataSource = dt; Drp_1.DataValueField = "ID"; Drp_1.DataTextField = "Content"; Drp_1.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { OdbcCommand cmda = conn_asset.CreateCommand(); conn_asset.Open(); cmda.CommandText = "select * from ast_deptMaster"; OdbcDataAdapter da = new OdbcDataAdapter(cmda); DataTable dt = new DataTable(); da.Fill(dt); dt.Columns.Add(new DataColumn("Title", System.Type.GetType("System.String"), "deptCode + ' - ' + deptName")); Drp_1.DataSource = dt; Drp_1.DataValueField = "deptCode"; Drp_1.DataTextField = "Title"; Drp_1.DataBind(); conn_asset.Close(); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { grid_display.Visible = false; grid_display1.Visible = false; btn_excel.Visible = false; btn_excel1.Visible = false; Drp_1.Visible = false; RequiredFieldValidator1.Enabled = false; OdbcCommand cmdb = conn_asset.CreateCommand(); conn_asset.Open(); cmdb.CommandText = "select * from master_spare_entry "; OdbcDataAdapter da1 = new OdbcDataAdapter(cmdb); DataTable dt1 = new DataTable(); da1.Fill(dt1); dt1.Columns.Add(new DataColumn("Title", System.Type.GetType("System.String"), "ID + ' - ' + description")); Drp_1.DataSource = dt1; Drp_1.DataValueField = "ID"; Drp_1.DataTextField = "Title"; Drp_1.DataBind(); conn_asset.Close(); } string selected = rdbtn_type.SelectedValue; if (selected == "1") { Drp_1.Visible = true; RequiredFieldValidator1.Enabled = true; } else { Drp_1.Visible = false; RequiredFieldValidator1.Enabled = false; } }
protected void Page_Load(object sender, EventArgs e) { string p_no = null; p_no = Session["user"].ToString(); if (!Page.IsPostBack) { string null_txt = null; OdbcCommand cmda = conn_asset.CreateCommand(); cmda.CommandText = "select astCode, userDescription, call_id from ast_call where ( p_no ='" + p_no.Trim() + "' and userRemark is NULL and callStat = 'C' )"; OdbcDataAdapter da = new OdbcDataAdapter(cmda); DataTable dt = new DataTable(); da.Fill(dt); dt.Columns.Add(new DataColumn("Desc", System.Type.GetType("System.String"), "astCode + ' - ' + userDescription")); dt.Columns.Add(new DataColumn("callid1", System.Type.GetType("System.Int64"), "call_id")); Drp_1.DataSource = dt; Drp_1.DataValueField = "callid1"; Drp_1.DataTextField = "Desc"; Drp_1.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { string p_no; p_no = Session["user"].ToString(); if (!Page.IsPostBack) { Drp_2.Visible = false; OdbcCommand cmda = conn_asset.CreateCommand(); cmda.CommandText = "select * from ast_master where custodian='" + p_no.Trim() + "'"; OdbcDataAdapter da = new OdbcDataAdapter(cmda); DataTable dt = new DataTable(); da.Fill(dt); dt.Columns.Add(new DataColumn("Title", System.Type.GetType("System.String"), "astCode + ' - ' + description")); Drp_1.DataSource = dt; Drp_1.DataValueField = "astCode"; Drp_1.DataTextField = "Title"; Drp_1.DataBind(); } }