void get_katval() { string com = "select ast_subkateast_Code,ast_subkateast_desc from Ref_ast_sub_kategri_Aset where Status='A' and ast_kategori_Code='" + DD_Kategori.SelectedValue + "'"; SqlDataAdapter adpt = new SqlDataAdapter(com, con); DataTable dt = new DataTable(); adpt.Fill(dt); DD_Sub_Kateg.DataSource = dt; DD_Sub_Kateg.DataTextField = "ast_subkateast_desc"; DD_Sub_Kateg.DataValueField = "ast_subkateast_Code"; DD_Sub_Kateg.DataBind(); DD_Sub_Kateg.Items.Insert(0, new ListItem("--- PILIH ---", "")); }
void sub_kategori() { DataSet Ds = new DataSet(); try { string com = "select ast_subkateast_Code,ast_subkateast_desc from Ref_ast_sub_kategri_Aset where Status='A'"; SqlDataAdapter adpt = new SqlDataAdapter(com, con); DataTable dt = new DataTable(); adpt.Fill(dt); DD_Sub_Kateg.DataSource = dt; DD_Sub_Kateg.DataTextField = "ast_subkateast_desc"; DD_Sub_Kateg.DataValueField = "ast_subkateast_Code"; DD_Sub_Kateg.DataBind(); DD_Sub_Kateg.Items.Insert(0, new ListItem("--- PILIH ---", "")); } catch (Exception ex) { throw ex; } }
protected void DD_Kategori_SelectedIndexChanged(object sender, EventArgs e) { DataSet Ds = new DataSet(); try { string com = "select ast_subkateast_Code,ast_subkateast_desc from Ref_ast_sub_kategri_Aset where ast_kategori_Code='" + DD_Kategori.SelectedItem.Value + "'"; SqlDataAdapter adpt = new SqlDataAdapter(com, con); DataTable dt = new DataTable(); adpt.Fill(dt); DD_Sub_Kateg.DataSource = dt; DD_Sub_Kateg.DataBind(); DD_Sub_Kateg.DataTextField = "ast_subkateast_desc"; DD_Sub_Kateg.DataValueField = "ast_subkateast_Code"; DD_Sub_Kateg.DataBind(); DD_Sub_Kateg.Items.Insert(0, new ListItem("--- PILIH ---", "")); //Grid_bnd(); } catch (Exception ex) { throw ex; } }