خرید بک لینک

Vote count: 0

At the moment I would like to run a store procedure that retus the count of the number of records. The records look like this

Records results

The stored procedure looks like

ALTER PROCEDURE [dbo].[USP_NEWFOLDER_COUNT]
-- Add the parameters for the stored procedure here

AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

    -- Insert statements for procedure here
    -- FileLocation is a table
SELECT @@ROWCOUNT FROM  FileLocation
END

The calling c# code is

    public String CountNewFolder()
    {
        tempInt = 0;
        using (SqlCoection sqlCon = new SqlCoection(coString))
        {
            SqlCommand sqlComm = new SqlCommand("USP_NEWFOLDER_COUNT", sqlCon);
            sqlComm.CommandType = CommandType.StoredProcedure;

            sqlCon.Open();
            tempInt = Convert.ToInt16(sqlComm.ExecuteScalar());
            sqlCon.Close();
        }
        retu tempInt.ToString();
    }

The result of my query is 0;

Any help or steers would be helpful. But, if poosible, could I get a quick explanation so that I won't make the same mistake again.

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: يکشنبه 26 ارديبهشت 1395 ساعت: 1:16

صفحه بندی