Hi,
I am trying to populate a field on my form, which is linked to an SQL
back-end database, but need assistance in referencing the field.
I am trying to use:
XDocument.DOM.selectSingleNode("/my:myfields/my:DataFields/my:TblStaffDetails/my:userName").text
to reference the field, which is called UserName and is part of the
d:TblStaffDetails group, which in turn is a member of the dataFields groups,
which in turn is a member of the myFields group.
The code above causes an error saying '... is null or not an object'. How do
I correctly reference the field so I can populate it onLoad.
Many thanks in advance for you help!
MatsonPP - 18 Apr 2005 13:13 GMT
I am going to assume that since you used the "my:" namespace in your
example, that you linked to the database by doing the "New from data
connection" when you created your form. So, if I follow your example in
reference to field and foler names, then the way to reference your
field is as such:
string str =
XDocument.DOM.selectSingleNode("//d:TblStaffDetails/@userName").text;
I hope that works,
Ciao,
Matt
Enterprise Andy - 18 Apr 2005 14:47 GMT
Thanks for the reply,
I have tried that and I still get and error complaining '... is null or not
an object'. Any ideas why?
> I am going to assume that since you used the "my:" namespace in your
> example, that you linked to the database by doing the "New from data
[quoted text clipped - 8 lines]
> Ciao,
> Matt