Kbase P113974: .NET Open Client receives an invalid cast exception when passing a DataSet and Temp-Table handles a
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  6/27/2006 |
|
Status: Unverified
FACT(s) (Environment):
OpenEdge 10.1A
SYMPTOM(s):
.NET open client receives an invalid cast exception
Specified cast is not valid.
Calling a procedure with a Dataset and Temp-Table handles as output parameter
The error does not occur in OpenEdge 10.0B
When changing the order of the output parameters in the procedure, the procedure runs fine from .NET
CAUSE:
This is a known issue being investigated by Development
FIX:
To work the problem around, reverse the order of the output parameters in the (.P) Progress procedure.
Instead of :
DEFINE OUTPUT PARAMETER DATASET-HANDLE hDS.
DEFINE OUTPUT PARAMETER TABLE-HANDLE hTT.
use the following:
DEFINE OUTPUT PARAMETER TABLE-HANDLE hTT.
DEFINE OUTPUT PARAMETER DATASET-HANDLE hDS.
The .NET proxy has to be regenerated from the ProxyGen, and the order of the parameters needs also to be changed in the .NET code when calling the procedure.
For example in C#, the initial code is:
DataSet hDS = new DataSet();
DataTable htt = new DataTable();
ao.newbug(out hDS, out htt);
and the code after applying the workaround is:
DataSet hDS = new DataSet();
DataTable htt = new DataTable();
ao.newbug(out htt, out hDS);