Cannot Create a Child list for Field

JesseH

Active member
Joined
Feb 9, 2006
Messages
42
Location
Sugar Land, TX
Programming Experience
10+
I can not find the cause of this error. Here is the code"

ODBCITHL15.SelectCommand.CommandText = "Select * from BPCSFV60.ITHL15" _
& " WHERE TPROD = '" & Me.txtPart.Text & "'"
ODBCITHL15.Fill(Ds1, "ITHL15")
If Ds1.Tables("ITHL15").Rows.Count = 0 Then
ErrorProvider1.SetError(txtPart, "No History Exist for this Product")
txtPart.Focus()
txtPart.SelectAll()
Exit Sub
End If
If (Convert.ToString(Ds1.Tables("ITHL15").Rows _
(0).Item("TPROD"))) = "" Then
ErrorProvider1.SetError(txtPart, "No History Exist for this Product")
txtPart.Focus()
txtPart.SelectAll()
Exit Sub
End If
' create the data relation
Ds1.Relations.Clear()
Dim parentCol As DataColumn
Dim childCol As DataColumn
parentCol = Ds1.Tables("ITHL15").Columns("TVEND")
childCol = Ds1.Tables("AVML01").Columns("VENDOR")
Dim ITHL15AVMl01 As DataRelation
ITHL15AVMl01 = New DataRelation("ITHAVM", parentCol, childCol)
Ds1.EnforceConstraints = False
Ds1.Relations.Add(ITHL15AVMl01)

Try
DataGrid1.SetDataBinding(Ds1, "ITHL15AVMl01") <=== error here
Catch ex As Exception
StatusBar1.Text = ex.Message
End Try


'*
Complete Error: Cannot create a childlist for field ITHL15AVMl01

Do you have any hints that I can try.

Thanks for the help.
 
Back
Top