in

SharePoint Blogs

The Best Place for SharePoint-related Blogs

Michael Hofer - SharePoint Blog

Michael Hofer's blog about adventures in SharePoint land, including tips and tricks for all products and technologies used in Information Worker solutions.

Maintaining database relations using ADO.NET DataSet from a WebService

(migrated post from November 21st 2006) 

There are many data sources that can be used in Infopath. One of the most interesting is definitely to load and save the data of a form to a webservice in form of an ADO.NET Recordset.This gives you the greates freedom in processing the data on both requests. I am not going into details on how to load and save data from/to a webservice, this is documentated already enough (see here f.e.: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_ip2003_tr/html/odc_INF_Lab_09.asp).

However, have you ever wondered how to work with a highly relational database schema as the datasource of your infopath form? Example: You want to gather project data. So you have (amongst others) a Projects-Table and some child tables (in this case: ProjectLocalSAPNumbers and ProjectBenefits) where you have a one-to-many relationship defined.
So, you create a new dataset, add the three (or more) tables and build relationships. Then you import the datasource to infopath.

Problem: In InfoPath you will get three nodes in the XMLSchema-Tree on the same level:

·         T_Project

·         T_ProjectLocalSAPNumber

·         T_ProjectBenefits


However, this is not at all what you’ve expected. Try now to create a form that respects the relationas in the database, meaning that the goals are a child entity of the project. It is simply not possible. You would have to place all project properties first and then all goals etc.

Solution

There are two relatively simple things you have to do on your dataset to enable infopath to interprete the schema correctly:

·         Set the attribute “IsNested” on the relations

·         Take the child element and drag it onto the parent table (Project). Now the child element is associated directly with the project element (see screenshot)

When you import your dataset from the webservice now to infopath, you’ll get what you want!

Published Jun 28 2007, 11:57 AM by mhofer1976
Filed under:

Comments

 

Links (6/28/2007) « Steve Pietrek’s SharePoint Stuff said:

Pingback from  Links (6/28/2007) « Steve Pietrek’s SharePoint Stuff

June 28, 2007 8:42 PM
 

ado net dataset said:

Pingback from  ado net dataset

June 3, 2008 7:30 PM

Leave a Comment

(required )  
(optional )
(required )  
Add

About mhofer1976

For all of my IT carreer, I've been addicted to Microsoft-based software development, starting with VB, but then heading straight towards the .NET Framework in its earliest days. While working in different positions as a lead developer, project manager, pre-sales consultant and most recently a business unit manager, I've always kept beeing a developer and specialized on solutions in the Information Worker area, with an emphasis towards Enterprise Content Management. The Microsoft Office System and especially the SharePoint products and technologies are my favorite "playground", one big reason why I've joined the Microsoft Consulting Services in Switzerland where I'm currently working as Senior Consultant for Information Worker solutions.

Need SharePoint Training? Attend a SharePoint Bootcamp!

Posts (c) their respective authors. Everything else (c) 2007 SharePoint Experts