hello
when i write code in infopath 2010 to get list data
this is code
SPSite site = new SPSite("http://sptest:100");
SPWeb web = site.OpenWeb();
SPList list = web.Lists["Countries"];
SPListItemCollection listitems = list.Items;
XPathNavigator nav = this.CreateNavigator().SelectSingleNode("/my:myFields/my:Countries", this.NamespaceManager);
foreach (SPListItem li in listitems)
{
XPathNavigator newNode = null;
newNode = nav.Clone();
newNode.SelectSingleNode("/my:myFields/my:Countries/my:Displayname", this.NamespaceManager).SetValue(li["Title"].ToString());
newNode.SelectSingleNode("/my:myFields/my:Countries/my:Value", this.NamespaceManager).SetValue(li["Title"].ToString());
nav.InsertAfter(newNode);
newNode = null;
}
nav.DeleteSelf();
nav = null;
i get this error
The Web application at http://sptest:100 could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL
Nour