Error: An error occurred accessing a data source - InfoPath Dev
in

InfoPath Dev

Error: An error occurred accessing a data source

Last post 05-09-2009 03:17 AM by saravanakumar38. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 05-09-2009 03:17 AM

    Error: An error occurred accessing a data source

    Hi,

     I am trying to create infopath form, which will load the repeating control with data at run time.

    This is the code that i am using at Form Load event

                XPathNavigator xn = this.MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:group1", this.NamespaceManager);

                XPathNavigator firstNode = xn.SelectSingleNode("/my:myFields/my:group1/my:group2[1]", this.NamespaceManager);

                XPathNavigator lastNode = xn.SelectSingleNode("/my:myFields/my:group1/my:group2[" + 1 + "]", this.NamespaceManager);

                firstNode.DeleteRange(lastNode);

                    foreach (DataRow row in dsProject.Tables[0].Rows)
                    {
                        xn.SelectSingleNode("/my:myFields/my:group1", this.NamespaceManager).AppendChild("<my:group2><my:f_ProjectId>" + row["ProjectId"].ToString() + "</my:f_ProjectId><my:f_ProjectName>" + row["ProjectName"].ToString() + "</my:f_ProjectName><my:f_ProjectDescription>" + row["Description"].ToString() + "</my:f_ProjectDescription></my:group2>");
                   
                    }

    when i click preview... It is working fine.

    But when i try to show this form in XmlFormViewer in share point it is showing "An error occurred accessing a data source."

    Can any one help me to solve this problem..

     

    Thanks,

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