Another problem for today :(
My Infopath file is bind to a SQL Server database for sending and reading data. From my 'Custom Task Pane' i can select nodes perfectly using for example :
node = XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:queryFields/q:sc_devis/@de_cmde_ref");
But i added to this document some fields wich are not binded to the database (myFileds -> right click -> add) and I try to fill them from the Custom Task Pane. But it doesn't work.
The fields can be accessed with my:query/@my:cmde_ref
I tried this in my TaskPane code :
node = XDocument.DOM.selectSingleNode("/my:myFields/my:query/@my:cmde_ref");
but without success, node is always null.
I precise that in the load event of the taskpane i put this line to access the namespaces :
XDocument.DOM.setProperty("SelectionNamespaces", 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:q="http://schemas.microsoft.com/office/infopath/2003/ado/queryFields" xmlns:d="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields" xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-05-24T12:32:04"');
Someone has an idea ?