M
mscertified
I hope this is the right forum. I'm a complete beginner at .NET and C#.
This is some code in a web service that calls an sproc that has an OUTPUT
parameter. Can anyone tell me how to code getting the output parameter? The
commented out code is a failed attempt. Thanks.
try
{
Database db = DatabaseFactory.CreateDatabase("SqlServices");
System.Data.Common.DbCommand dbCommand =
db.GetStoredProcCommand("MonthlyPaymentList");
db.AddInParameter(dbCommand, "AsOfDate", DbType.DateTime,
AsOfDate);
db.AddOutParameter(dbCommand, "ErrorId", DbType.Int64, 16);
DataSet ds = db.ExecuteDataSet(dbCommand);
//int errorId = (int)db.GetParameterValue(dbCommand,
"ErrorId");
//if (errorId != 0)
//{
// return null;
//}
return ds;
}
This is some code in a web service that calls an sproc that has an OUTPUT
parameter. Can anyone tell me how to code getting the output parameter? The
commented out code is a failed attempt. Thanks.
try
{
Database db = DatabaseFactory.CreateDatabase("SqlServices");
System.Data.Common.DbCommand dbCommand =
db.GetStoredProcCommand("MonthlyPaymentList");
db.AddInParameter(dbCommand, "AsOfDate", DbType.DateTime,
AsOfDate);
db.AddOutParameter(dbCommand, "ErrorId", DbType.Int64, 16);
DataSet ds = db.ExecuteDataSet(dbCommand);
//int errorId = (int)db.GetParameterValue(dbCommand,
"ErrorId");
//if (errorId != 0)
//{
// return null;
//}
return ds;
}