Hi,
Does anyone know how to do it? I have an oCommandWrapper that has an
input paramater{{"@registrationId",DbType.String,strRegC ode}} and two
output paramerters {{"@strSessionTime",DbType.DateTime,8},
{"@strCourseName",DbType.String,200}}. The
db.ExecuteNonQuery(oCommandWrapper) is successfully executed. I am
trying to use the following code to retrieve the output values and put
them in aryRtnParams which is an object[]. So far I could only get the
last value out, due to the aryRtnParams is reinitialized at every loop.
for (byte byteThisPos=0; byteThisPos < aryOut.Length; byteThisPos++)
{
object[] aryParamStruct = (object[])aryOut[byteThisPos];
aryRtnParams = new
object[]{oCommandWrapper.GetParameterValue(aryParamStruct[0].ToString())};
}
When I tried the following code, I got an error of
"System.NullReferenceException Object reference not set to an instance
of an object".
for (byte byteThisPos=0; byteThisPos < aryOut.Length; byteThisPos++)
{
object[] aryParamStruct = (object[])aryOut[byteThisPos];
aryRtnParams[byteThisPos] = new
object[]{oCommandWrapper.GetParameterValue(aryParamStruct[0].ToString())};
}