C
ChrisB
Hello:
I am trying to use an output parameter with the data access application
block and seem to be running into some difficulties. Specifically, I am
receiving the error message: "Object reference not set to a reference of an
object" when I attempt to access the parameter value.
Component code (setup of parameters):
SqlParameter[] consumerParameters = new SqlParameter[2];
consumerParameters[0] = new SqlParameter("@ConsumerID", 1);
consumerParameters[1] = new SqlParameter("@Checksum", 0);
consumerParameters[1].Direction = ParameterDirection.Output;
SafeDataReader safeDataReader = new
SafeDataReader(SqlHelper.ExecuteReader(sqlTransaction,
CommandType.StoredProcedure, "ConsumerGet", consumerParameters));
. . .
_checksum = int.Parse(consumerParameters[1].Value.ToString()); // receive
error message here
Stored Procedure code:
CREATE PROCEDURE ConsumerGet
(@ConsumerID [uniqueidentifier],
@Checksum [bigint] Output)
etc.
Thanks for any input.
Chris
I am trying to use an output parameter with the data access application
block and seem to be running into some difficulties. Specifically, I am
receiving the error message: "Object reference not set to a reference of an
object" when I attempt to access the parameter value.
Component code (setup of parameters):
SqlParameter[] consumerParameters = new SqlParameter[2];
consumerParameters[0] = new SqlParameter("@ConsumerID", 1);
consumerParameters[1] = new SqlParameter("@Checksum", 0);
consumerParameters[1].Direction = ParameterDirection.Output;
SafeDataReader safeDataReader = new
SafeDataReader(SqlHelper.ExecuteReader(sqlTransaction,
CommandType.StoredProcedure, "ConsumerGet", consumerParameters));
. . .
_checksum = int.Parse(consumerParameters[1].Value.ToString()); // receive
error message here
Stored Procedure code:
CREATE PROCEDURE ConsumerGet
(@ConsumerID [uniqueidentifier],
@Checksum [bigint] Output)
etc.
Thanks for any input.
Chris