private void KategoriaDLL() { SqlConnection con = Generals.GetNewConnection(); try { SqlCommand cmd = new SqlCommand("Select KategoriaID, VleraKategorise from Kategoria", con); SqlDataReader rdr = cmd.ExecuteReader(); KategoriaDropDownList.DataTextField = "VleraKategorise"; KategoriaDropDownList.DataValueField = "KategoriaID"; KategoriaDropDownList.DataSource = rdr; KategoriaDropDownList.DataBind(); KategoriaDropDownList.Items.Insert(0, "Selekto Kategorin"); } finally { con.Close(); } }
private void PunetoriiDLL() { SqlConnection con = Generals.GetNewConnection(); try { SqlCommand cmd = new SqlCommand("Select RoliID, Roli from Roli", con); SqlDataReader rdr = cmd.ExecuteReader(); RoliDropDownList.DataTextField = "Roli"; RoliDropDownList.DataValueField = "RoliID"; RoliDropDownList.DataSource = rdr; RoliDropDownList.DataBind(); RoliDropDownList.Items.Insert(0, "Selekto Rolin"); } finally { con.Close(); } }
private void GrupiDLL() { SqlConnection con = Generals.GetNewConnection(); try { SqlCommand cmd = new SqlCommand("Select GrupiID, Grupi from Grupi", con); SqlDataReader rdr = cmd.ExecuteReader(); GrupiDropDownList.DataTextField = "Grupi"; GrupiDropDownList.DataValueField = "GrupiID"; GrupiDropDownList.DataSource = rdr; GrupiDropDownList.DataBind(); GrupiDropDownList.Items.Insert(0, "Selekto Grupin"); } finally { con.Close(); } }