DataGridView.Clear()
To clear the datagridview
write the following code:
dataGridView1.DataSource=null;
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.
If I remember correctly, I set the DataSource property to null to clear the DataGridView:
datagridview.DataSource = null;