Following Error in this line.
datagridview1.Rows.Clear()
but this line gives error:
Cannot clear this list.
You can use this simple method: First clear your DataTable and then refresh your DataGridView
dataTable.Clear(); dataGridView.Refresh();
Hope this help