Hello-
I have been trying to get a form to use a data connection and execute a SELECT statement to get a value, then put that value on a form. I know this isn't difficult but I cannot see what I am missing. Here is my code - I think it is pretty self explanatory:
public void CTRL645_5_Clicked(object sender, ClickedEventArgs e)
{
XPathNavigator MDMid = CreateNavigator().SelectSingleNode("/my:myFields/my:sectCommon/my:MDMid", NamespaceManager);
XPathNavigator custName = CreateNavigator().SelectSingleNode("/my:myFields/my:sectCommon/my:custName", NamespaceManager);
XPathNavigator RetCustName = CreateNavigator().SelectSingleNode("/dfs:myFields/dfs:dataFields/d:DAL_PARTY/@CUST_NAME", NamespaceManager);
string MDMidNum = MDMid.InnerXml;
AdoQueryConnection myAdoQueryConnection = (AdoQueryConnection)(this.DataConnections["DAL_PARTY"]);
myAdoQueryConnection.Command = "select CUST_NAME from [DAL_PARTY] where [ROWID_OBJECT] = " + MDMidNum;
myAdoQueryConnection.Execute();
custName.SetValue(RetCustName.Value);
}
I am receiving a null object exception on the last line, but I copied the XPath and pasted it. What could I be missing? I know the data is there...
Thanks in advance,
-Drew