create dynamic object[]
- From: androidsun@xxxxxxxxx
- Date: 12 Jan 2006 16:44:36 -0800
Hi,
Does anyone know how to do it? I have an oCommandWrapper that has an
input paramater{{"@registrationId",DbType.String,strRegCode}} 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())};
}
.
- Follow-Ups:
- Re: create dynamic object[]
- From: Rudderius
- Re: create dynamic object[]
- Prev by Date: Adding custom Mail header to System.Net.Mail.MailMessage
- Next by Date: Custom panels
- Previous by thread: Adding custom Mail header to System.Net.Mail.MailMessage
- Next by thread: Re: create dynamic object[]
- Index(es):
Loading