By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,041 Members | 1,018 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,041 IT Pros & Developers. It's quick & easy.

cannot create a child list

P: n/a
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
Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Sorry..I know my error .
Me.dgInvoiceDetail.DataMember = "InvoiceDetail.fk_invno" <-should
be "InvoiceHeader.fk_invno"
"Agnes" <ag***@dynamictech.com.hk> bl
news:uR****************@TK2MSFTNGP11.phx.gbl g...
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

Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.