Following Error in this line.
datagridview1.Rows.Clear()
but this line gives error:
Cannot clear this list.
First clear DataSource and then clear DataGridView
in VB
datagridview1.DataSource = Nothing datagridview1.Rows.Clear()
hope help