Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void TypComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
- {
- ComboBox comboBox = (ComboBox)sender;
- SqlCommand command = new SqlCommand("SELECT nazwa FROM wszystkie_produkty WHERE Kategoria = @kategoria Typ = @typ");
- command.Parameters.AddWithValue("@kategoria", KategoriaComboBox.SelectedItem.ToString());
- command.Parameters.AddWithValue("@typ", TypComboBox.SelectedItem.ToString());
- if (dataSet.Tables.Contains("Produktyy"))
- {
- dataSet.Tables.Remove(dataSet.Tables["Produktyy"]);
- }
- dataSet = baza_zapytan.DodajTabeleDataSet(command, new string[] { "Produktyy" }, ref dataSet);
- ProduktComboBox.Items.Clear();
- foreach (DataRow row in dataSet.Tables["Produktyy"].Rows)
- {
- ProduktComboBox.Items.Add(row["nazwa"].ToString());
- }
- if (produkt_ID > 0)
- {
- ProduktComboBox.SelectedItem = dataSet.Tables["Produkt"].Rows[0]["nazwa"].ToString();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement