Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
- {
- //ilosc
- using (SqlConnection con = new SqlConnection(polaczenieBaza))
- {
- con.Open();
- try
- {
- string Sql = "select m.ilosc from produkt p join magazyn m on p.idProdukt = m.idProduktu where p.nazwaProduktu ='" + comboBox1.ToString() +"'";
- using (SqlCommand cmd = new SqlCommand(Sql, con))
- {
- result1 = ((int)cmd.ExecuteScalar());
- label3.Text = result1.ToString();
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.ToString());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement