private void addproduct_click(object sender, RoutedEventArgs e)
{
string sqlcom = $"INSERT INTO ingredientdata (name, year) VALUES ('{tb2.Text}','{tb1.Text}')";
if (connectToDB.Connect())
{
using (MySqlCommand command = new MySqlCommand(sqlcom, connectToDB.connection))
command.ExecuteNonQuery();
connectToDB.CloseConnect();
MessageBox.Show("Сохранилось");
}
}