Within the stored procedure
CREATE PROCEDURE [dbo].[GetReturnValue]Enterprise Library call
AS
RETURN 1
Database db = DatabaseFactory.CreateDatabase();HTH.
DbCommand cmd = db.GetStoredProcCommand("dbo.GetReturnValue");
db.AddParameter(cmd, "return_value", DbType.Int32, ParameterDirection.ReturnValue, null, DataRowVersion.Default, null);
db.ExecuteNonQuery(cmd);
int myReturnValue = Convert.ToInt32(db.GetParameterValue(cmd, "return_value"));
This is really helpful and working code.
ReplyDelete