Repeating section and database

J

Jamesy

Hi folks,
I am using SQL Server as the "submit" main data connection for my form. I
would like to add a repeating section to my form, but don't know the datatype
for the column in SQL Server to bind the control to it.

Any suggestions would be gratefully received.

Many thanks,

Jamesy
 
S

Scott L. Heim [MSFT]

Hi Jamesy,

This may be easier:

- Display the Data Source Task Pane
- Expand the "dataFields"
- Drag the "table" that contains your data to your form and release
- Select Repeating Section with Controls
- If there are more fields that what you want, simply delete those from the
Repeating Section (not from the actual Data Source!)

Let me know if this works!

Scott L. Heim
Microsoft Developer Support

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

Jamesy

Hi Scott,
I tried your advice thanks. However, I need to populate both tables from the
form - and can only see how to add one datasource of SQL Server connection as
a "submit" source - when originally creating the form.

Am I being dim here?

Many thanks,

Jamesy
 
S

Scott L. Heim [MSFT]

Are the tables "related?" For example, "one" customer could have "many"
orders so a Customers and Orders table would be related on a CustomerID
field.

Scott L. Heim
Microsoft Developer Support

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

Jamesy

Hi Scott,
Yup there is a relationship. This is a travel booking system, so someone
could need to book X number of flights per trip - hence I'm using a repeated
section for flights, another for hotels etc.

Jamesy
 
S

Scott L. Heim [MSFT]

Hi Jamesy,

Then you should be good to go. When you created your InfoPath solution, you
created it from the database...correct? If so, you would simply need to
include the tables you need. For instance - let's take Customers, Orders
and Order Details. One customer can have zero or more orders and each order
can have zero or more line items. So when I create an InfoPath solution to
enable adding/editing these pieces of information, I first add the
Customers table, then the Orders and finally the Order Details.

Now if you are familiar with these tables, you will know there are other
fields such as EmployeeID, Shipper, etc. If you notice, I did not include
those in my "main" data source - these would be considered secondary data
sources and I would use them in conjunction with a drop-down list so the
user can simply select a Shipper.

So with my main data source consisting of Customers, Orders and Order
Details, I can add a new customer by itself or immediately include an order
with or without line items. In addition, I could query for, say, a
CustomerID and then modify all or any one of the tables. In each case, when
I click the Submit button the appropriate table(s) will be updated.

I do hope I am not making this more confusing for you. If this still does
not make sense, let me know and I will provide the steps to see this work
using the Northwind sample database.

Scott L. Heim
Microsoft Developer Support

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

Jamesy

That's perfect thanks Scott. I have to say that, the more I use this product,
the more impressed I am.

Many thanks for all your help.

Jamesy
 

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