yes the code in sp ALTER PROCEDURE [dbo].[sp_Paging]@pageNumber INT = 1,@TotalRecord INT OUTPUT,@StatementType varchar(20)IF @StatementType = 'PKaryawan' BEGIN SELECT NIK, nmKaryawan FROM ( SELECT NTILE(1000) OVER (ORDER BY IdKaryawan) AS [page], NIK, nmKaryawan FROM dbo.Karyawan ) AS dep WHERE [page] = @pageNumber; --SET @TotalRecord='SELECT ROW_NUMBER() OVER(ORDER BY idKaryawan) as row from karyawan' SELECT @TotalRecord=COUNT(*) FROM Karyawan END
and for my program code below sorry Out Of Topic for my program with dmDakom.spPaging do begin StoredProcName:='sp_Paging'; Prepare; ParamByName('PageNumber').Value:=j; ParamByName('StatementType').AsString:='PKaryawan'; LRecord:=ParamByName('TotalRecord').AsInteger; Label8.Caption:=IntToStr(LRecord); end; dmDakom.spPaging.Active:=True;
the result variable LRecord zero..???