Using layers won't return value from stored procedure

J

JB

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top