M
mscertified
Web method calls sproc that returns output parameter
how do I code this?
I am a complete beginner to .NET and web services. Here is code:
[WebMethod, Description("Run Monthly Payment Summary Report")]
public DataSet MonthlyPaymentSummary(string AsOfDate, out string
ErrorId)
{
try
{
Database db = DatabaseFactory.CreateDatabase("SqlServices");
System.Data.Common.DbCommand dbCommand =
db.GetStoredProcCommand("MonthlyPaymentSummary", AsOfDate);
DataSet ds = db.ExecuteDataSet(dbCommand);
return ds;
}
catch (Exception e)
{
ExceptionPolicy.HandleException(e, "Log and Alert Policy");
return null;
}
}
I get error "our parm 'errorid' must be assigned to before control leaves
current method'.
I have no clue what this means. If errorid is zero it is a good condition
otherwise it is an error condition.
Another question is can I use anything other than 'string', I tried
'datetime' and it was rejected, my AsOfDate parameter is a datetime value.
Thanks for any help.
how do I code this?
I am a complete beginner to .NET and web services. Here is code:
[WebMethod, Description("Run Monthly Payment Summary Report")]
public DataSet MonthlyPaymentSummary(string AsOfDate, out string
ErrorId)
{
try
{
Database db = DatabaseFactory.CreateDatabase("SqlServices");
System.Data.Common.DbCommand dbCommand =
db.GetStoredProcCommand("MonthlyPaymentSummary", AsOfDate);
DataSet ds = db.ExecuteDataSet(dbCommand);
return ds;
}
catch (Exception e)
{
ExceptionPolicy.HandleException(e, "Log and Alert Policy");
return null;
}
}
I get error "our parm 'errorid' must be assigned to before control leaves
current method'.
I have no clue what this means. If errorid is zero it is a good condition
otherwise it is an error condition.
Another question is can I use anything other than 'string', I tried
'datetime' and it was rejected, my AsOfDate parameter is a datetime value.
Thanks for any help.