Sql server and Infopath - InfoPath Dev
in

InfoPath Dev

Sql server and Infopath

Last post 09-25-2008 01:32 AM by sambita123. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 09-23-2008 02:03 AM

    Sql server and Infopath

     Hay i am new to infopath.

    I have a textbox and according to that textbox value i am filtering data from sql database.now in the datset i have the data ,but how to bind it in infopath form.

    I Need help ! ! !

     

    Thanks & Regards
    Sambita
  • 09-24-2008 11:33 PM In reply to

    Re: Sql server and Infopath

     To which control do you want to bind the dataset?

    You can add a secondary dataconnection that returns the dataset and bind it to controls like dropdown or any repeating control by going to the property window of the control.


    Do let me know if you need any further info.

     

    Thanks,
    Paresh

    http://www.openzeas.com/blogs/Paresh/default.aspx

  • 09-24-2008 11:42 PM In reply to

    Re: Sql server and Infopath

     You can also take a look at the following link that has some steps that involves achieving what you are trying to do:

    http://blogs.msdn.com/infopath/archive/2006/10/12/cascading-dropdowns-in-browser-forms.aspx

     

    Thanks,

    Paresh

  • 09-25-2008 12:44 AM In reply to

    Re: Sql server and Infopath

    thanks paresh for the help.

     Actually i have a textbox in which i will write any item which i want to search,then i will click the button and after that it will search from sql database and it will show the matching items in a repeateting table.

    So in button cllick event i have used some coding,

    SqlConnection cn = new SqlConnection("server=aaa;database=CMS;UID=xyz;PWD=***;");
                cn.Open();
                SqlCommand cm = new SqlCommand();
                cm.Connection = cn;
                cm.CommandType = CommandType.Text;
                cm.CommandText = "select * from AreaMaster";
                SqlDataAdapter da = new SqlDataAdapter(cm);
                DataSet ds = new DataSet();
                da.Fill(ds);

                XmlNamespaceManager ns = this.NamespaceManager;
              
                XPathNavigator node = this.CreateNavigator().SelectSingleNode("/my:myFields/my:txt", NamespaceManager);
              
                for(int i=0;i<ds.Tables[0].Rows.Count;i++)
                {
                    if (ds.Tables[0].Rows[i][1].ToString() == node.Value)
                    {
                    
                        cm.CommandText="select * from AreaMaster where AreaName='" + node.Value + "'";
                        DataSet ds1 = new DataSet();
                        da.Fill(ds1);

                     

                    }
                }

     

    So now in data set i got the data's but my problem is how to show the data's in info path form.

    As i am new to infopath don't have that much idae...

    if their is any other way to do it..then let me know..........

    So please help me.

     

    Thanks & Regards
    Sambita
  • 09-25-2008 01:26 AM In reply to

    Re: Sql server and Infopath

    One way that I would suggest is to write a web service method that returns the dataset.  Then add this webmethod as a secondary data connection in your infopath form and bind the dropdown with the return value of your webmethod i.e. the dataset.

     

    HTH

     

    Thanks,

    Paresh

    http://www.openzeas.com/blogs/Paresh/default.aspx

  • 09-25-2008 01:32 AM In reply to

    Re: Sql server and Infopath

     thanks for the reply..

    let me try... in this way.. 

    Thanks & Regards
    Sambita
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.