Given that I have the attached SmartObject (that has been deployed) with the following schema: Name: DB2
Method: GetStopCodes
With the following code:
private static string getStopCodesForPolicy(string PolicyNumber)
{
string retStopCodesForPolicy = string.Empty;
using (SOConnection soConn = new SOConnection("Integrated=True;IsPrimaryLogin=True;Authenticate=True;EncryptedPassword=False;Server=txs9312137;Port=5555"))
{
soConn.Open();
string soQuery = "SELECT * FROM DB2.GetStopCodes WHERE POL_NBR_TXT='" + PolicyNumber+"'";
using (SOCommand soCmd = new SOCommand(soQuery, soConn))
{
soCmd.CommandType = CommandType.Text;
using (SODataAdapter soDA = new SODataAdapter(soCmd))
{
soDA.AcceptChangesDuringFill = true;
soDA.FillLoadOption = LoadOption.OverwriteChanges;
using (DataSet ds = new DataSet())
{
soDA.Fill(ds, "Results");
if (ds.Tables[0].Rows.Count > 0)
{
string[] stopCodes = new string[ds.Tables[0].Rows.Count];
for (int index = 0; index < stopCodes.Length; index++)
{
DataRow dr = ds.Tables[0].Rows[index];
stopCodes[index] = dr["POL_STOP_CD"].ToString();
}
retStopCodesForPolicy = string.Join(",", stopCodes);
}
}
}
}
}
return retStopCodesForPolicy;
}
I am receiving an error on the soDA.Fill(ds, "Results");
line of "Invalid SmartMethod name 'GetStopCodes' for SmartObject with name 'DB2'.
"
Can anyone tell me why? (I'm using 0803)
Thanks!