Function DispalyGuardianDetials(ByVal UserName As String, ByVal Stype As Integer) As Integer Dim Sqlcust As String Dim Phonenumber As String Dim spt() As String Dim i As Int16 Sqlcust = "" If Stype = 0 Then Sqlcust = "select*from Tbl_MstGuardian where CONTACTNAME='" & UserName & "'" ElseIf Stype = 1 Then Sqlcust = "select*from Tbl_MstGuardian where Maxid='" & UserName & "'" End If 'Call clearfieldsGaurdian() Rsc = New SqlCommand(Sqlcust, con) 'Rsc.ExecuteNonQuery() Rsd = Rsc.ExecuteReader() If Rsd.Read = True Then TxtGname.Text = Rsd("contactname") TxtGucode.Text = Rsd("usercode") The error is Index out of range exception was unhandled by usercode TxtGAge.Text = Rsd("AGE") TxtGDob.Text = Rsd("DOB") TxtGRelationship.Text = Rsd("relationship") TxtGAdd.Text = Rsd("ADDRESS1") TxtGLand.Text = Rsd("landmark") TxtGPin.Text = Rsd("pincode") TxtGArea.Text = Rsd("area") TxtGCity.Text = Rsd("city") TxtGState.Text = Rsd("state") TxtGCountry.Text = Rsd("country")
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)