468,765 Members | 1,413 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,765 developers. It's quick & easy.

cannot create a child list

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
1 1950
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.

Similar topics

8 posts views Thread by ASP Yaboh | last post: by
reply views Thread by =?Utf-8?B?QXR1bCBSYW5l?= | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.