I have a database with MySQL which is connected with C# windows application.
My problem is that I have a form with 2 buttons and datagridview. The one button is exit and the other is clear.
With the button clear I want to clear all the data in the database and I can’t do this.
The only thing I have done is to clear the entries and then when I reopen the entities are there!
THE CODE IS:
private void button3_Click(object sender, EventArgs e)
{ //clear balance
projectpizzaDataSet ds = new projectpizzaDataSet();
projectpizzaDataSetTableAdapters.balanceTableAdapter daCust = new projectpizzaDataSetTableAdapters.balanceTableAdapter();
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
dataGridView1.Rows.RemoveAt(i); //delete error
}
}