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,