473,395 Members | 1,458 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 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 2112
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Primo | last post by:
Hi, This problem has been frustrating me for days and I hope you experts can help me out. I am trying to run a command, which I would normally run from the command line, from within my C#...
0
by: Dica | last post by:
i'm just trying out c# and VS 2003 for the first time and i'm running into an error: "Cannot create a child list for field tblProjects" the section of code that seems to be throwing this is:...
8
by: ASP Yaboh | last post by:
I have an ArrayList of data gathered from a database. I want to create a web page from this data by creating a <table>, each cell in each row displays the appropriate data. One of those cells in...
4
by: normb | last post by:
My name is Norm, I changed something that caused this problem, and I do not what it was. I also do not know how to debug this problem! The line where the crash occures is marked by an *. The...
0
by: Pete Newman | last post by:
In running vs (vb ) .net 2005 and Sql 2005 On my form i have an oledbconnection, an oledbdataadapter and a dataset. when i try and do an update i get an error; 'Child list for field...
1
by: nitinkhare1 | last post by:
Please help,I'm very frustated. when I ADD the data in kn_history_question table of htbase_tst database....it giving the error "Cannot add or update a child row:a foreign key constraint...
1
by: Allan Ebdrup | last post by:
I get the error: "Cannot create an object of type 'CustomWizard' from its string representation 'CustomWizard1' for the CustomWizard Property." when I view my custom server web control in...
4
by: sirjohnofthewest | last post by:
If I possessed the power to sway the mind of every user in the world to delete all forms of Internet Explorer I would die a happy man. Hi guys, I frequently visit this site to get answers to my...
0
by: =?Utf-8?B?QXR1bCBSYW5l?= | last post by:
Hi, I am using datagridview when, I am assigning datasource to Datagridview i am gettin exception "Child list for field Region cannot be created." I am Assigning Collection as a datasource to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.