F
Fred Exley
Here's the sqlserver procedure:
------------------------------------------------------------------------
ALTER PROCEDURE monte_monte.Proc_Ingrs
/*
(
@parameter1 int = 5,
@parameter2 datatype OUTPUT
)
*/
@dsSQLOutputCursor cursor varying OUTPUT
AS
/* SET NOCOUNT ON */
SET @dsSQLOutputCursor = CURSOR FOR
SELECT NDB_No, FDGRP_CD, DESCRIPTION, USED FROM tblIngredients WHERE FdGrp_Cd = '0400'
OPEN @dsSQLOutputCursor
RETURN
------------------------------------------------------------------------
And heres my c# attempt to call this procedure:
// SqlServer database call:
Database db = DatabaseFactory.CreateDatabase("monte_Plan9ConnectionString");
DataSet dsSQLOutputCursor = new DataSet();
DbCommand dbCommand = db.GetStoredProcCommand("Proc_Ingrs",dsSQLOutputCursor);
//db.AddInParameter(dbCommand, dsSQLOutputCursor, DbType.Int32, 7);
dsSQLOutputCursor = db.ExecuteDataSet(dbCommand);
msgBack = "Datasets were accessed successfully.";
------------------------------------------------------------------------
ALTER PROCEDURE monte_monte.Proc_Ingrs
/*
(
@parameter1 int = 5,
@parameter2 datatype OUTPUT
)
*/
@dsSQLOutputCursor cursor varying OUTPUT
AS
/* SET NOCOUNT ON */
SET @dsSQLOutputCursor = CURSOR FOR
SELECT NDB_No, FDGRP_CD, DESCRIPTION, USED FROM tblIngredients WHERE FdGrp_Cd = '0400'
OPEN @dsSQLOutputCursor
RETURN
------------------------------------------------------------------------
And heres my c# attempt to call this procedure:
// SqlServer database call:
Database db = DatabaseFactory.CreateDatabase("monte_Plan9ConnectionString");
DataSet dsSQLOutputCursor = new DataSet();
DbCommand dbCommand = db.GetStoredProcCommand("Proc_Ingrs",dsSQLOutputCursor);
//db.AddInParameter(dbCommand, dsSQLOutputCursor, DbType.Int32, 7);
dsSQLOutputCursor = db.ExecuteDataSet(dbCommand);
msgBack = "Datasets were accessed successfully.";