Please be kind to take a look
dsSeaInvInfo.Clear()
daSeaInvInfo.SelectCommand = New SqlCommand
daSeaInvInfo.SelectCommand.Connection = conSea
daSeaInvInfo.TableMappings.Add("Table", "invoiceheader")
daSeaInvInfo.SelectCommand.CommandText = "select * from
invoiceheader"
daSeaInvInfo.Fill(dsSeaInvInfo, "invoiceheader")
daSeaInvInfo.SelectCommand.CommandText = "select * from
invoicedetail "
daSeaInvInfo.Fill(dsSeaInvInfo, "invoicedetail")
Dim cb As New SqlCommandBuilder(daSeaInvInfo)
dtInvInfo = dsSeaInvInfo.Tables("invoiceheader")
dtInvDetail = dsSeaInvInfo.Tables("invoicedetail")
Dim constraint_invno As New ForeignKeyConstraint("fk_invno",
dtInvInfo.Columns("number"), dtInvDetail.Columns("number"))
dtInvDetail.Constraints.Add(constraint_invno)
dsSeaInvInfo.Relations.Add("fk_invno",
dtInvInfo.Columns("number"), dtInvDetail.Columns("number"), False)
'Marking Setting
Me.dgInvoiceDetail.DataSource = dsSeaInvInfo
Me.dgInvoiceDetail.DataMember = "InvoiceDetail.fk_invno" <-- it
return error (Cannot create a child list .................)
I got another similar program with similar codes, it works fine. However,
for the above case, both "number" are char (20) , I don't know why I can't
create the child list