Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Using layers won't return value from stored procedure (http://www.velocityreviews.com/forums/t728723-using-layers-wont-return-value-from-stored-procedure.html)

JB 07-20-2010 12:45 AM

Using layers won't return value from stored procedure
 
Hello Community

In my ASP.Net program using C# I call a
stored procedure but no memberno value returns. This is how
I call the method from C#:

int membernum = 0;
dset = loadNewMember(memberno);
membernum = memberno;

--- This layer calls the stored procedure:

public DataSet loadNewMember(int memberno)
{
DataSet dset1 = new DataSet();

string dsetErrors = "";
SqlParameter[] Params = { new SqlParameter("@memberno", memberno) };

try
{
if ("spGetNewMember", @Params, 30)
{
return dset1 ;
}
return dset1;
}
catch (Exception ex)
{
dsetErrors = ex.Message;
}
return dset1 ;
}


---This is the stored procedure that calls that doesn't return the value for
memberno:

Alter PROCEDURE [dbo].[spGetNewMember]
(@memberno int)
AS
BEGIN
Select @memberno = max(ID)
From MemberTable
return @memberno
END
go


Why doesn't the memberno get returned?

Jeff
--
JB


All times are GMT. The time now is 05:14 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.