http://walisystems.com/articles/SPS/dropdown2/sharepoint_list_data.htm
The source code from above link is running just fine. When I downloaded the code and run on server it runs fine and all values from list populates. But when I run it from my own solution it does not populate and gives this error.
Microsoft.Office.InfoPath.Server.SolutionLifetime.SchemaValidationException: Schema validation found non-datatype errors.
at Microsoft.Office.InfoPath.Server.SolutionLifetime.SchemaValidation.Validate(Document document, XPathNavigator subtreeToValidate, XmlOperation operation)
at Microsoft.Office.InfoPath.Server.DocumentLifetime.XmlNotificationManager.DoSchemaValidation(XmlNodeChangedEventArgs e)
at Microsoft.Office.InfoPath.Server.DocumentLifetime.XmlNotificationManager.NodeChangedHandler(Object sender, DomEventArgs e)
at Microsoft.Office.InfoPath.Server.Xml.DomEvents.FireQueuedEvents()
at Microsoft.Office.InfoPath.Server.Xml.DomEvents.AfterEventHandler(Object sender, XmlNodeChangedEventArgs e)
at System.Xml.XmlDocument.AfterEvent(XmlNodeChangedEventArgs args)
at System.Xml.XmlNode.AfterEvent(XmlNodeChangedEventArgs args)
at System.Xml.XmlNode.InsertAfter(XmlNode newChild, XmlNode refChild)
at System.Xml.DocumentXmlWriter.Close(WriteState currentState)
at System.Xml.XmlWellFormedWriter.Close()
at System.Xml.XPath.XPathNavigator.InsertAfter(XmlReader newSibling)
at System.Xml.XPath.XPathNavigator.InsertAfter(XPathNavigator newSibling)
at Microsoft.Office.InfoPath.Server.Xml.XPath.InfoPathXPathNavigator.InsertAfter(XPathNavigator newSibling)
at Microsoft.Office.InfoPath.Server.Xml.XPath.XPathNavigatorHost.<>c__DisplayClass58.<InsertAfter>b__57()
at Microsoft.Office.InfoPath.Server.DocumentLifetime.OMExceptionManager.ExecuteOMCallWithExceptions(OMCall d, ExceptionFilter exceptionFilter)
at Microsoft.Office.InfoPath.Server.DocumentLifetime.OMSecurityContext.ExecuteOMCall(Solution solution, SecurityLevel methodSecurityLevel, ExceptionFilter exceptionFilter, OMCall d)
at Microsoft.Office.InfoPath.Server.Xml.XPath.XPathNavigatorHost.InsertAfter(XPathNavigator newSibling)
at testing1.FormCode.AddDepartment() in C:\Documents and Settings\chandrashekhar.rai\My Documents\InfoPath Projects\testing11\FormCode.cs:line 114
Any help is appreciated.