Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Using layers won't return value from stored procedure

Reply
Thread Tools

Using layers won't return value from stored procedure

 
 
JB
Guest
Posts: n/a
 
      07-20-2010
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
stored procedure return value question philip ASP .Net 2 08-10-2006 03:42 PM
Is there a possibility to call a stored procedure on the MSSQL DB without java to wait for a return value? gagu911@gmx.ch Java 3 11-30-2005 03:59 PM
Stored Procedure Return value question Nick ASP .Net 8 02-10-2005 02:32 PM
Return a value from stored procedure to calling application Paul ASP .Net 1 01-19-2004 05:06 PM
Stored Procedure has both return value and data set (SqlDataReader) Neo Chou ASP .Net 1 08-03-2003 06:23 AM



Advertisments