DOM is null?

W

wjasonstrutz

I have an Infopath form that connects to a database as its main data source. Users can query the database based on email address or last name. The query is handled through managed code (C#), by first calling thisXDocument.query() then checking the returned value. If no result was returned, I have code to create a new record with some default values.

For one database entry in particular, the test to see if the record exists fails with:

A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in microsoft.office.interop.infopath.semitrust.dll

Additional information: The query method on the Document object failed.
??
InfoPath cannot run the specified query.
The file is not a valid XML document.

After some debugging, I discovered that for this particular email address / name, Infopath and Visual Studio claim that thisXDocument.DOM does not exist! However, looking at the local variables, I can see all the fields that should be there according to my form template. All of the DataTypes for these nodes is DBNull. The code functions fine for every other entry I've tried, whether the entry exists in the database or not.

Does anybody have any idea what could cause this?
Thanks,
jason.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top