Accessing nodes in different data source trees

F

Frowin

I've got a problem with different data source trees. I have one form with 2
or more different web server requests/queries. Each request/queriy I has
it's own data source tree.
Now the problem is in accessing tree-element (nodes). When I start the form,
I only have access to the data in the main source tree.
How to switch (?) to one of the other data trees? I need to access and copy
data from one tree to the other in the same form after a web server
request/query.

Thanks for help

Frowin
 
V

virgul

Hi,

when you are in design mode click data source (in view button,
datasource)that open the task pane if it isen't. Under datasource: you
have a dropdown listbox and you can choose which source you wan't to
see and after you can drag and drop your element.


++
 
F

Frowin

Hi virgul

Thanks for it, but this wasn't the question/problem. I want to access nodes
in the code. With"XDocument.DOM.selectSingleNode()" I only get null, when
when I try to access a node in the wrong data tree. It always appears the
Main tree (data source), but I want to access nodes in the secondary tree
(second request/query).

How to access different data trees in the code (when the form will be used
by a user).

Frowin
 
G

Greg Belenky

How to access different data trees in the code (when the form will be used
by a user).

use XDocument.DataObjects(' ...' ).DOM instead of XDocument.DOM.
place your datasource name in place of ...
 
F

Frowin

Thanks to everybody

I finally can access my data in the different data sources.

var billerDataObj = XDocument.GetDOM( "getBillerData" );
var billerDataNamespace = "xmlns:dfs='http://schem......";
billerDataObj.setProperty( "SelectionNamespaces", billerDataNamespace );
var status = billerDataObj.selectSingleNode( "..." );

Thank you

Frowin


Greg Collins said:
Use XDocument.GetDOM("MyDataSource).selectSingleNode("XPath"); instead.

--
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com



Hi virgul

Thanks for it, but this wasn't the question/problem. I want to access nodes
in the code. With"XDocument.DOM.selectSingleNode()" I only get null, when
when I try to access a node in the wrong data tree. It always appears the
Main tree (data source), but I want to access nodes in the secondary tree
(second request/query).

How to access different data trees in the code (when the form will be used
by a user).

Frowin


virgul said:
Hi,

when you are in design mode click data source (in view button,
datasource)that open the task pane if it isen't. Under datasource: you
have a dropdown listbox and you can choose which source you wan't to
see and after you can drag and drop your element.


++
 
D

DavidGaravit

Hi
I have the same issue as "Frowin" and I used your suggestion, but I got an
error:
----
Code:
Set objFieldsDataNode =
XDocument.GetDOM("PR_V1").selectSingleNode("/dfs:myFields/dfs:dataFields")
Error:
Reference to undeclared namespace prefix: 'dfs'.
----

I copied the "XPath" by right click on secondary data base over the
dataFields group.

Any clues???

regards


Greg Collins said:
Use XDocument.GetDOM("MyDataSource).selectSingleNode("XPath"); instead.

--
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com



Hi virgul

Thanks for it, but this wasn't the question/problem. I want to access nodes
in the code. With"XDocument.DOM.selectSingleNode()" I only get null, when
when I try to access a node in the wrong data tree. It always appears the
Main tree (data source), but I want to access nodes in the secondary tree
(second request/query).

How to access different data trees in the code (when the form will be used
by a user).

Frowin


virgul said:
Hi,

when you are in design mode click data source (in view button,
datasource)that open the task pane if it isen't. Under datasource: you
have a dropdown listbox and you can choose which source you wan't to
see and after you can drag and drop your element.


++
 
D

DavidGaravit

Hi everyone.............I found a way to overide the error. I created the
form and add the data source (access db) as the main data source.

But I have another one.

How can I specify the data source to submit??
This is the deal:
1) Insert some values in Access database
2) To insert them, I use: XDocument.Submit
3) Read the ID generated for the inserted value
4) Finally submit the form (by clicking a button) to a share point

The problem is that step (2) is generating me errors 'cause that command is
submitting to the Access database and to the sharepoint at the same time

How can I specify in step (2), to submit only to my Access DB???

DavidGaravit said:
Hi
I have the same issue as "Frowin" and I used your suggestion, but I got an
error:
----
Code:
Set objFieldsDataNode =
XDocument.GetDOM("PR_V1").selectSingleNode("/dfs:myFields/dfs:dataFields")
Error:
Reference to undeclared namespace prefix: 'dfs'.
----

I copied the "XPath" by right click on secondary data base over the
dataFields group.

Any clues???

regards


Greg Collins said:
Use XDocument.GetDOM("MyDataSource).selectSingleNode("XPath"); instead.

--
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com



Hi virgul

Thanks for it, but this wasn't the question/problem. I want to access nodes
in the code. With"XDocument.DOM.selectSingleNode()" I only get null, when
when I try to access a node in the wrong data tree. It always appears the
Main tree (data source), but I want to access nodes in the secondary tree
(second request/query).

How to access different data trees in the code (when the form will be used
by a user).

Frowin


virgul said:
Hi,

when you are in design mode click data source (in view button,
datasource)that open the task pane if it isen't. Under datasource: you
have a dropdown listbox and you can choose which source you wan't to
see and after you can drag and drop your element.


++
 

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