craig buckner

craig buckner

  • NA
  • 1
  • 1.4k

Need to get the Row Count after execute a Stored Prodcedure

Feb 14 2013 7:34 AM
I am trying to get the total amount of records that my stored procedure returns

using the SP
CREATE PROCEDURE [dbo].NewSelectCommand
(
@catID int
)
AS
SET NOCOUNT ON;
SELECT catID, title, size, type, printon, inkType, item, imageUrl, transferID FROM TransferDesigns WHERE (catID = @catID)
RETURN @@ROWCOUNT

Then on the aspx.cs file

        KraftDataContext dataContext = new KraftDataContext();

        var catNames = dataContext.NewSelectCommand(catID);
        DataList1.DataSource = catNames;
        DataList1.DataBind();

Now when I debug the breakpoint before DataBind there is a ResultValue or ReturnValue with the correct amount under NewSelectCommandResults in it but I cant seem to get it there is ISingleResult Well anyway I need the total number of returned records so I can build the PageSize