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 / December 2005

Tip: Looking for answers? Try searching our database.

Changing datatype property of a node element

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
BethA - 26 Dec 2005 22:38 GMT
I'm struggling with trying to get some Booleans in my schema to behave
correctly. It seems that when I declare the node like this:

Dim oOnDSNNode As IXMLDOMElement =
thisXDocument.DOM.selectSingleNode("my:myFields/my:OnDSN")

the datatype of oOnDSNNode is set to DBNull instead of boolean (OnDSN in my
schema is set as a boolean).

I've tried to find a way to make sure the datatype property of oOnDSNNode is
boolean, but I'm stuck!

Can someone help please? Thanks!

Beth A.
Franck Dauché - 27 Dec 2005 03:03 GMT
Hi Beth,

I am afraid datatype won't help you much.  If you really need to check the
nature of your node, the only way that I know of is to load you schema as a
separate document from your code and to check through that.  This is not
straight forward, if you can avoid it...
Why don't you pick a naming convention, such as all boolean nodes starts by
"b"

Hope that it helps.

Regards,

Franck Dauché

> I'm struggling with trying to get some Booleans in my schema to behave
> correctly. It seems that when I declare the node like this:
[quoted text clipped - 11 lines]
>
> Beth A.
BethA - 27 Dec 2005 15:05 GMT
The nodes in question are boolean in the schema. The problem comes up when I
declare a node in VB.net and assign it to this node (while the boolean is
empty), the declared node has a null datatype and I get an error that it
can't be converted to boolean. I'm going to try it again, first giving those
fields a default value.

Beth A.

> Hi Beth,
>
[quoted text clipped - 26 lines]
> >
> > Beth A.
BethA - 27 Dec 2005 15:16 GMT
I really meant that I would required the field to not be blank. That didn't
make a difference. I still get an error at the line:

oOnDSNNode.nodeTypedValue = mDSN

where mDSN is a boolean variable - I get the error:

Cast from type 'DBNull' to type 'Boolean' is not valid.

Any ideas?

Thanks,
Beth
Franck Dauché - 27 Dec 2005 15:16 GMT
How are you assigning the value?  .text = "true"?

Regards,

Franck Dauché

> The nodes in question are boolean in the schema. The problem comes up when I
> declare a node in VB.net and assign it to this node (while the boolean is
[quoted text clipped - 34 lines]
> > >
> > > Beth A.
BethA - 28 Dec 2005 16:23 GMT
I have a boolean variable mDSN that I want to assign to the nodetypedvalue
property of the node:

oOnDSNNode.nodeTypedValue = mDSN

That's when I get the error. The node oOnDSNNode seems to be assigned to the
correct thing.

I think the problem may have started when I changed the original field from
boolean to text and then back to boolean. (I was having a problem with the
boolean field getting a -1 assigned for true.) Now I need to get this working!

Thanks,
Beth

Rate this thread:






 
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.