471,874 Members | 1,806 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,874 software developers and data experts.

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 2058
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
reply views Thread by YellowAndGreen | last post: by
reply views Thread by zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.