0
Answer

Need to get the Row Count after execute a Stored Prodcedure

Ask a question
craig buckner

craig buckner

11y
1.2k
1
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