SQL as Main Data Source Question

G

Guest

I want to use SQL as my main data source.

I have multiple tables that I want to use. I want them to appear as repeating groups under some root node.

For example, if I have SQL tables such as:

Names
Addresses
PhoneNumbers

I want my main data source to look something (doesn't have to be exactly) like:

<RootNode>
<Names>
<Name> (repeating)
</Names>
<Addresses>
<Address> (repeating)
</Addresses>
<PhoneNumbers>
<PhoneNumber> (repeating)
</PhoneNumbers>
</RootNode>

I just want all of them to be able to repeat. I want to be able to edit multiple tables and submit them back all from the main data source.

Is this possible? If so, how do I go about doing it?
 
S

Scott L. Heim [MSFT]

Hi,

Are your tables "related" in SQL Server? If so, when you create your
InfoPath solution from a data source, you will need to choose the table -
once you have that table selected you can then choose to Add Tables. This
will provide you with a new window to specify the related fields.

So for instance you would first choose the "Names" table - once this is
shown in InfoPath, click the Add Tables button and select the Addresses
table. Once you do so, you will need to specify the related fields.

Now, if the Phone Numbers table is actually related to the Names table and
not the Addresses table, you will need to be sure you have highlighted the
Names table in InfoPath before you click the Add Tables button again.

I hope this helps!

Best Regards,

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Guest

This produces a simlilar, yet different structure than what I'm looking for. I don't want any relations present in the InfoPath form... I just want to have a series of repeating structures--each one representing a table in SQL.




Hi,

Are your tables "related" in SQL Server? If so, when you create your
InfoPath solution from a data source, you will need to choose the table -
once you have that table selected you can then choose to Add Tables. This
will provide you with a new window to specify the related fields.

So for instance you would first choose the "Names" table - once this is
shown in InfoPath, click the Add Tables button and select the Addresses
table. Once you do so, you will need to specify the related fields.

Now, if the Phone Numbers table is actually related to the Names table and
not the Addresses table, you will need to be sure you have highlighted the
Names table in InfoPath before you click the Add Tables button again.

I hope this helps!

Best Regards,

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 
S

Scott L. Heim [MSFT]

Hi,

InfoPath can only have one "main" data source so if your tables are not
related in any way, there is no real way to bring them into your InfoPath
solution as a "single" data source. If you create a web service, you could
conceivably add a secondary data connection that could be used to "submit"
data but this still may not provide you with what you desire.

I do have a question though: if the data is not related whatsoever, what is
the benefit of bringing all of this together into one form?

Scott L. Heim
Microsoft Developer Support

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

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