How display data in drop-down - InfoPath Dev
in

InfoPath Dev

How display data in drop-down

Last post 12-19-2007 09:37 AM by Greg Collins. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 12-18-2007 06:24 AM

    • assaxi
    • Not Ranked
    • Joined on 11-06-2007
    • Posts 7

    How display data in drop-down

    How data display in drop-down (field1) in infopath

    public void FormEvents_Loading(object sender, LoadingEventArgs e)

            {

                SqlConnection con;

                SqlCommand cmd = new SqlCommand();

                SqlDataAdapter da;

                DataSet ds = new DataSet();

                con = new SqlConnection("Data Source = 111.111.111.111; Initial catalog = database; Integrated Security = True");

                cmd.CommandText = "SELECT Pracownicy FROM Karta WHERE Day >= 10 AND Pracownicy.[Login] = 'zorro'";

                cmd.Connection = con;

                con.Open();

                DataSources[0].QueryConnection.Execute();

                string result = Connection.SelectSingleNode("/my:mojePola/my:field1", NamespaceManager).Value;

            }

  • 12-18-2007 11:08 AM In reply to

    Re: How display data in drop-down

    Create a secondary data source to your SQL. You can always update the SQL command in code.

    Configure your drop-down control (in the view) to populate its values from the secondary data source DOM.

    Then you can requery all you want in code, and the drop-down will repopulate based on the returned results.

  • 12-19-2007 12:26 AM In reply to

    • assaxi
    • Not Ranked
    • Joined on 11-06-2007
    • Posts 7

    Re: How display data in drop-down

    OK bat I dont now haw display this data in drop down.

    Do you have code example

  • 12-19-2007 09:37 AM In reply to

    Re: How display data in drop-down

    There is no code. You simply right-click the drop-down list box control in the view, choose Properties, and then set it up to pull its options from your secondary data source. That's it.

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.