Combobox combination to create another

0

Hello! I am trying to make a combination between two combobox, where a third one shows the list with the products that contains the category and the brand, but when I do not have any product registered with the two attributes, I would like it to show some alert saying that there is no product registered with these attributes, but I did not find the right way to do it!

I can not explain the situation very well, but I hope you understand kkkk I will attach the images with the code and the error that appears when I post information that has no product. The database I use is MySQL, if it helps.

Here the product exists with the attribute "category" and "brand":

asked by anonymous 03.06.2017 / 19:41

1 answer

0

Show the error in a MessageBox. It would look like this:

catch (Exception erro)
{
    MessageBox.Show("Não existe nenhum produto cadastrado com esses atributos!\nErro: " + erro);
}
    
04.06.2017 / 00:52