I have an InfoPath form that contain 2 text box type Integer.
I have a button that click on me operate this code (in c#):
public void CTRL17_5_OnClick(DocActionEvent e)
{
IXMLDOMNode node1 =this.thisXDocument.DOM.selectSingleNode("//my:myFields/my:field1");
IXMLDOMNode node2 =this.thisXDocument.DOM.selectSingleNode("//my:myFields/my:field2");
int num1;
num1=Int32.Parse(node1.text);
num1=num1+5;
node2.text=num1.ToString();
}
If I change field2 to be type String (and not Integer) and It's work well.
But if I change back field2 to by type Integer I get an Error about "nil" ,After I added this line to the code:
node2.attributes.removeNamedItem("xsi:nil");
It's work well.
What is this line mean? and why I need itwhen I operate assignation on a field type Integer