| « Google Apps: Enable a group to be able to write e-mails with the group address | Ubuntu 8.04.4 LTS + mysqlhotcopy = "...at line 1 at /usr/bin/mysqlhotcopy line 473" » |
Today I had hours of fun with InfoPath: What I was trying to do was basically fill some repeating groups with SharePoint list data by querying it programmatically with CAML. The problem was the "some": One group would work and some other ones would throw an exception like this one:
System.InvalidOperationException wurde nicht von Benutzercode behandelt.
Message="Nicht datentypbezogene Fehler bei der Schemaüberprüfung."
Source="Microsoft.Office.InfoPath.Client.Internal.Host.Interop"
StackTrace:
at Microsoft.MsoOffice.InfoPath.MsxmlInterop.MsxmlDocument.ThrowExceptionFromMsxmlInteropError(MsxmlInteropError eError)
at Microsoft.MsoOffice.InfoPath.MsxmlInterop.MsxmlDocument.ThrowExceptionFromHresult(Int32 hrError)
at Microsoft.MsoOffice.InfoPath.MsxmlInterop.MsxmlNodeImpl.AppendChild(String strXml)
at Microsoft.Office.InfoPath.MsxmlWriter.Close()
at System.Xml.XmlWellFormedWriter.Close()
at XYZ.FormCode.LoadAffectedProductsChoice()
at XYZ.FormCode.FormEvents_Loading(Object sender, LoadingEventArgs e)
at Microsoft.Office.InfoPath.Internal.FormEventsHost.OnLoad(DocReturnEvent pEvent)
at Microsoft.Office.Interop.InfoPath.SemiTrust._XDocumentEventSink2_SinkHelper.OnLoad(DocReturnEvent pEvent)
The code causing the problem looked like:
String myNamespace = NamespaceManager.LookupNamespace("my");
XPathNavigator node = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:RelatedCrsChoiceGroup", this.NamespaceManager);
using (XmlWriter writer = node.AppendChild())
{
writer.WriteStartElement("RelatedCrsChoice", myNamespace);
writer.WriteElementString("relatedCrId", myNamespace, "abc");
writer.WriteElementString("relatedCrTitle", myNamespace, "def");
writer.WriteEndElement();
writer.Close();
}
The issue was that I set up the repeating groups within one group. The last defined repeating group in the data connections would not throw the error, all others do.
The solution was as simple as to give every single repeating group a dedicated top group - and all errors were gone.