Infopath SP1 - ADO.Net Dataset parent-child

W

Weenie the Pooh

I am using a very simple .Net web service as datasource for Infopath.
This web service returns a strongly-typed Dataset with two tables
(Topic and Item) and a parent-child relation (FK TopicId in the Item
table).

Infopath does not interpret correctly the schema. Here is the
structure it shows:
- datafields
--getTopicResponse
---getTopicResult
----ns2:topicDS
-----(choice)
------Topic
------Item

where it should logically be something like
----ns2:topicDS
-----Topic
------Item

Has anyone had the same kind of problem and what is the solution ?


Thank
 
G

G. Tarazi

The (choice) is always there because the original dataset structure has the
previous and new changes.



But anyway, use a regular xml file, you may get the dataset to work, but
there are several bugs in SP1 related to the datasets, and they will make
you live harder once the project goes bigger.
 
J

jb

I don't know if you're still interested, but I was reading your post
yesterday and facing the same problem.

Now I have found the solution! You are using a DataRelation for the
relationship, right? By default, this has a property "Nested" which is set
to false. IP effectively then ignores your relation, because the structure
of the XML is "flat". You just need to set your parent-child
DataRelation.Nested = true. Now the XML for the dataset has your child
actually nested inside your parent: "Item" is now *inside* "Topic" instead of
a sibling, just as you need.

I am finding IP documentation to do with DataSets & WebServices rather
"lacking". This, for example, is a vital concept when using DataSets.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top