.NETGURU
Error: Can't create child list
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.adonet.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...

Dennis
I have a master table named keywwordsets and two child tables keywords and
searchphrase. I created relations in the xsd file: ID to KeywordSetID in
both cases. In the underlying Access database these same relationships are
also defined.

The KeywordSet table is bound to 3 textboxes and a checkbox. The child
tables are bound to grids. The datasources are the dataset dsWKS1 and the
datamembers are the relations
KeywordSets.KeywordSetsKeywords
KeywordSets.KeywordSetsSearchPhrase

I tried several times to make a datamember that didn't start with the
KeywordSets table (somehow this seems wrong to me) but the compiler rejected
all my attempts.

When I try to open frmFullWord I get the following error

system.argumentexception
cannot create a child list for field KeywordSetsKeyword
system.windows.forms.bindingcontext.ensurelistmanager
system.windows.forms.bindingcontext.get_item
frmFullWord_Load line 679

The line is cmK = CType(BindingContext(dsWKS1,
"KeywordSets.KeywordSetsKeyword"), CurrencyManager)

in the snippet

Try
cm = CType(BindingContext(dsWKS1, "KeyWordSets"), CurrencyManager)
AddHandler cm.ItemChanged, AddressOf cm_ItemChanged
AddHandler cm.PositionChanged, AddressOf cm_PositionChanged
AddHandler daWKS.RowUpdated, AddressOf OnRowUpDated
cmK = CType(BindingContext(dsWKS1,
"KeywordSets.KeywordSetsKeyword"), CurrencyManager)
cmSP = CType(BindingContext(dsWKS1,
"KeywordSets.KeywordSetsSearchPhrase"), CurrencyManager)

daWKS.Fill(dsWKS1, "KeywordSets")
daWK.Fill(dsWKS1, "Keywords")
daWSP.Fill(dsWKS1, "SearchPhrase")

Can somebody please help me solve this error?

Thanks.

Dennis
Reply to this message...
 
    
Kevin Yu [MSFT] (VIP)
Hi Dennis,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you have bind your Textboxes and
DataGrids to the DataSet. However, when you're trying to get the
CurrencyManager from binding context, an ArgumentException is thrown. If
there is any misunderstanding, please feel free to let me know.

Based on the exception message, I think there might be something wrong with
the parameters for getting the BindingContext. What to be the datasource
and what to be the datamember depends on how you add bindings to each
control. Could you show me the code that you bind the Textbox? If you could
email me the package with repro steps, it will be more quickly for me to
resolve it. Thanks!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Reply to this message...
 
    
Dennis
Thanks Kevin,

I will do both. I set the datasource and datamembers in the property box.
I'll list those.
I want to mention that the error doesn't occur on the curency manager cm.
It occurs in cmK, the currency manager for the Keywords Table. I'm sure you
saw that, but I'm just being extra cautious.

Here are the property settings for the dgrdKeyword
DataSource dsWKS1
The choices were
dsWKS1.Keywords
dsWks1.KeywordSets
dsWKS1.SearchPhrase

If I choose dsWKS1.Keywords, the choices for datamember are only 'none'.
Similar to SearchPrhase.

Under dswks1.KeywordSets the choices for datamember are keywordsetskeyword
and keywordsetssearchphrase.

Similarly, under dswks1, the choices are keywordsets -> datamembers choices
keywordsetskeywords and keywordsetssearchphrases.

There are also the choices keywords and searchphrase, but they lead to
datamembers 'none'.

I choices dswks1 as the datasource.

Thanks again.

I am also sending you the app with instructions.

Dennis

Reply to this message...
 
    
Kevin Yu [MSFT] (VIP)
Hi Dennis,

Thanks for your code. Based on my debugging, there are 2 points of mistakes.

1. dgrdKeyword has the wrong value and DataSource and DataMember. Please
check and set the DataSource to dsWKS1, and DataMember to
"KeywordSets.KeywordSetsKeywords".

2. There is a mis-spelling in your code when trying to get the
CurrencyManager cmK. You missed an 's' in DataMember. It has to be
"KeywordSets.KeywordSetsKeywords" instead of
"KeywordSets.KeywordSetsKeyword". Please correct the code with the
following line.

cmK = CType(BindingContext(dsWKS1, "KeywordSets.KeywordSetsKeywords"),
CurrencyManager)

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Reply to this message...
 
    
Dennis
Well, what do you know.....

Thanks Kevin,

Dennis

"Kevin Yu [MSFT]" wrote:

[Original message clipped]

Reply to this message...
 
    
[MSFT] (VIP)
Hi Dennis,

Did Kevin's suggestion work in your project? If you still have any concerns
on this issue, please feel free to let me know.

Regards,

Luke

Reply to this message...
 
 
System.ArgumentException
System.Data.DataSet
System.Windows.Forms.BindingContext
System.Windows.Forms.CurrencyManager




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification