This error comes out whenever I clicked the datagrid.
Program does fill the datagrid every time data was selected in the combobox. For example: I choose data1 which has 4 records in datagrid. then I click row index no 1. No problem will shown but when I choose again another data in combobox, for example: Data 2 has only 1 record then I will clicked again the datagrid. This is the time that error will pop up.
Please see Code on how I fill the data grid:
Sub FillDtgPir(ByVal qry As String)
Try
If SQLConn1.State = ConnectionState.Closed Then SQLConn1.Open()
Dim adap As New SqlDataAdapter(qry, SQLConn1)
Me.DtsLineReq1.PRRMS_PIR.Clear()
adap.Fill(Me.DtsLineReq1, "PRRMS_PIR")
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Is there missing in the code?