Cannot populate drop-down list data from DB - InfoPath Dev
in

InfoPath Dev

Cannot populate drop-down list data from DB

Last post 09-27-2005 06:56 AM by vt_asparagus. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 09-20-2005 04:52 PM

    Cannot populate drop-down list data from DB

    I cannot populate the values of drop down lists from a database. I can enter the values manually and this updates to the database but cannot display the current value in the database. It just displays the default value.

    I try to use the 'lookup in data connection' option, however I cannot point it to either the data field or query field. The data field understandable says "this is where the field saves data", the query field says "you must select a repeating field or group". All I want is for the field to display the data that it is linked to.

    Can anyone offer a solution?

    -- Jay Whittaker --
  • 09-20-2005 07:30 PM In reply to

    Re: Cannot populate drop-down list data from DB

    Check out - Lab 8: Data Sources in InfoPath 2003 -http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_ip2003_tr/html/odc_INF_Lab_08.asp

    Review Exercise 2: Populate a List Box with Values from an XML Document - this may help.

    Also check out this lab when you have some more bandwidth - Lab 9: ADO.NET DataSets in InfoPath 2003 -http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_ip2003_tr/html/odc_INF_Lab_09.asp
    Jason
    http://www.k2distillery.com/
  • 09-20-2005 11:30 PM In reply to

    Re: Cannot populate drop-down list data from DB

    The exercise you refer to is one of the tasks that I tried. I cannot bind the data to a data source. This is when I am getting the error.

    I select the data source, and then should be able bind the infopath field to a database field - as I have done in all other types of infopath fields. However I get error messages.

    I am only able to enter the options manually - this is fine to update the database but is unable to reflect back the database value when viewing the form.



    -- Jay Whittaker --
  • 09-20-2005 11:44 PM In reply to

    Re: Cannot populate drop-down list data from DB

    Hi Jay,
    Why not just try out our Database Accelerator product. It requires no code and gets you up and running with databases with none of this hassle. Check out the free evaluation version athttp://www.infopathdev.com/downloads/free/EvalTools/InfoPathDev.com%20Tools%20-%20Forms%20Database%20Accelerator.%20v1.0.zip. Also, check out the Premium Downloads forum for tips and tricks.
    Cheers,

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 09-26-2005 11:38 PM In reply to

    Re: Cannot populate drop-down list data from DB

    Have found that this problem occurs with all field types except text fields. It saves the data in the database (e.g. true/false - for a radio button), however the field's default value is displayed in Sharepoint not the correct data value. For example, I have a list box. It can save information in the database, however when I open the form again it is displaying the first value in the options, not the set value. I could get around this by connecting the field to the database however I get an error telling me it must connect to a repeating field. I cannot get around this.

    This seems like another huge limitation to Infopath.

    -- Jay Whittaker --
  • 09-27-2005 06:56 AM In reply to

    Re: Cannot populate drop-down list data from DB

    Thanks for the info. So you are opening a InfoPath form through SharePoint. When you are saying you "open the form again" are you pressing the "Fill out form" button? If so, it makes complete sense that the form would be opened to its default values.

    Also, inspect your XML in your secondary data source. I think this may be your problem. When InfoPath connects to a secondary data source like a webservice or sqlserver DB, it will try to build a schema locally in the InfoPath form to represent the data it expects back. When you are building a secondary data source through the tools menu, there is a step where InfoPath asks you to provide sample data. I have found this is where InfoPath will build that schema from.

    For instance lets say I have a webservice that returns a DataSet. The webservice also takes a value part description (that can take a wildcard). If I were to provide "steel" I would get back the following:

    <Parts>
    <Part><PartNo>1</PartNo></Part>
    </Parts>

    In this situation, looking at the XML, InfoPath would NOT INFER that <Part> is a repeating structure.

    If I were to change the sample data to be "Steel*", I would get the following XML:

    <Parts>
    <Part><PartNo>1</PartNo></Part>
    <Part><PartNo>2</PartNo></Part>
    <Part><PartNo>3</PartNo></Part>
    </Parts>

    Now <Part> can be infered to be a repeating structure.
    Jason
    http://www.k2distillery.com/
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.