Answer the question
In order to leave comments, you need to log in
How to update the contents of a DataGrid?
Adding items to the DataGrid:
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("Сохранилось");
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question