DataGridView.Clear()

Solution 1:

I'm betting you just need to refresh the datagrid. Try this:

dataGridView1.Rows.Clear();
dataGridView1.Refresh();

If this works... you might want to rethink this part of your application.

Solution 2:

If I remember correctly, I set the DataSource property to null to clear the DataGridView:

datagridview.DataSource = null;

Solution 3:

To clear the datagridview write the following code:

dataGridView1.DataSource=null;