We could get the above error while trying to set value for a field using XPathNavigator. The reason could be that the field has the nil attribute set
Most of the fields with the exception of String Type uses nil to indicate “no value”.
So before we could set the value for those fields, we need to remove the nil attribute from it.
We could use the below code for that.
XPathNavigator node= MainDataSource.CreateNavigator()
.SelectSingleNode(“/my:myFields/my:lblSpecHours”, NamespaceManager);
if (node.MoveToAttribute(“nil”,
“http://www.w3.org/2001/XMLSchema-instance”))
node.DeleteSelf();
node.SetValue(txtValue);
Bye..
Discover more from Nishant Rana's Weblog
Subscribe to get the latest posts sent to your email.

Hi,
I have the error which you have described above and was directed to your site from a MSDN forum. I am not a programmer and the code I am using is copied from a solution on a MSDN article.
As I am not a programmer I’m unsure as to how to apply your solution. When I pasted it into my Visual Studio solution it didn’t ‘like’ it, but I think it is down to the language – mine is in C#, is yours in VB?
Can you provide some assistance if I send you the code?
Regards,
Richard
LikeLike