Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / March 2006

Tip: Looking for answers? Try searching our database.

Prevent from Deleting the secondary Datasource

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DolceVita - 16 Mar 2006 09:15 GMT
Hi,

When I make an appendChild with an IXMLDOMNode of my Secondary
Datasource the node selected is erase from my Secondary Datasource!

How can I prevent this?

My Code:

IXMLDOMNode Old = e.Source.parentNode.parentNode;

IXMLDOMDocument2 oDomgetHRGBisher =
(IXMLDOMDocument2)thisXDocument.GetDOM("getHRGBisher");
oDomgetHRGBisher.setProperty("SelectionNamespaces",
"xmlns:dfs=\"http://schemas.microsoft.com/office/infopath/2003/dataFormSolution\"
xmlns:ns2=\"http://tempuri.org/\"");

IXMLDOMNode SelectBisher =
oDomgetHRGBisher.selectSingleNode("/dfs:myFields/dfs:dataFields/ns2:getHRGBisherResponse/ns2:getHRGBisherResult/ListBisher/Bisher[@fldID="
+ FLDID +"]");

if (SelectBisher != null)
  {
      Old.appendChild(SelectBisher);
  }

Thanks for your help!
DolceVita - 17 Mar 2006 16:22 GMT
Ok I have found:

if (SelectBisher != null)
  {
      IXMLDOMNode SelectBisher2 = SelectBisher.CloneNode(false);
      Old.appendChild(SelectBisher2);
  }

cloneNode can can true or false:

true: Copy child of the node and the node

false: Copy only the node with the attribute.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.