- Version is 2.5 Final, runtime versions is 2.5.08.0122
- Yes the connection string is present
- Only happens when using ExecuteScalarQuery
--This code works
public string PONextNumber1(int poid)
{
using (DataAccessAdapter adapter = new DataAccessAdapter())
{
DataTable dt = RetrievalProcedures.GetPONextNumber(poid, adapter);
return dt.Rows.Count == 0 ? string.Empty : dt.Rows[0][0].ToString();
}
}
--This code does not
public string PONextNumber2(int poid)
{
using (DataAccessAdapter adapter = new DataAccessAdapter())
{
RetrievalQuery retrievalQuery = RetrievalProcedures.GetGetPONextNumberCallAsQuery(poid);
return adapter.ExecuteScalarQuery(retrievalQuery).ToString();
}
}
Using Lutz, you can see that the ExecuteActionQuery checks the connection of the query, and if not set, it assigns it the _activeConnection. The ExecuteScalarQuery does not check/set the query connection and I am not seeing a way to set the active connection myself before calling.
Brian