I have bind the DataGridview with DB. To add the data from textboxes to DataGrid, I use the foll. code-
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Try
Dim row0 As String() = {TextBox1.Text, TextBox2.Text, TextBox3.Text}
DataGridView1.Rows.Add(row0)
row0 = Nothing
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Error is coming
Rows cannot be programmatically added to the DataGridView's rows collection when the control is data-bound
there is no any way to add data to the Gridview if we bound it to the Database.