Преобразования хранимой процедуры в C#
Привет Everybuddy я работаю над игровым приложением...! и там мне нужно преобразовать хранимую процедуру в код c#..! я пытался сделать это, но не смог достичь...! пожалуйста, помогите мне, мой код соблюдается.....!
Примечание:- Я не хочу называть эту процедуру в моем приложении..! просто преобразуйте эту процедуру в c#!
set ANSI_NULLS ON set QUOTED_IDENTIFIER ON go ALTER PROCEDURE [dbo].[CancelRegistrations] @mTourID numeric(18, 0) , @MoneyType char(1) AS DECLARE @Credit float, @TicketNo varchar(10), @username varchar(30), @TicketTourID numeric(18,0), @userId int, @pIP nvarchar(15), @realmoney float, @skinid int BEGIN DECLARE CANCREG_CUR CURSOR FOR SELECT Nickname,Credit,TicketNo,skinid FROM tblRegistration WHERE TournamentID = @mTourID ORDER BY RegID OPEN CANCREG_CUR FETCH NEXT FROM CANCREG_CUR INTO @username,@Credit,@TicketNo,@skinid WHILE @@FETCH_STATUS = 0 BEGIN SELECT @userId=isnull(UserID,0),@realmoney=realmoney FROM tblUsers WHERE nickname=@username and skinid=@skinid IF @TicketNo != '' BEGIN SELECT @TicketTourID=TournamentID FROM tblTickets WHERE TicketNo=@TicketNo IF @TicketTourID = 0 BEGIN UPDATE tblTickets SET Status='V' WHERE TicketNo=@TicketNo END INSERT INTO tblTransMaster(UserID,TransDate,TransMode,Amount, Source,Details,IP,realmoney,CReason,currencysign) VALUES(@userId ,getdate(),'D',0,'TEXAS MTT SERVER', 'UNREGISTERED FROM TOURNAMENT - ' + Convert(varchar,@mTourID) + ' DUE TO TOURNAMENT CANCELLATION', @pIP ,@realmoney,'TOURNAMENT CANCELLED','TICKET') DELETE FROM tblRegistration WHERE nickname=@username and skinid=@skinid END ELSE IF @MoneyType='R' BEGIN UPDATE tblUsers SET RealMoney=RealMoney + @Credit WHERE nickname=@username and skinid=@skinid INSERT INTO tblTransMaster(UserID,TransDate,TransMode,Amount, Source,Details,IP,realmoney,CReason,currencysign) VALUES(@userId ,getdate(),'D',@Credit,'TEXAS MTT SERVER', 'UNREGISTERED FROM TOURNAMENT - ' + Convert(varchar,@mTourID) + ' DUE TO TOURNAMENT CANCELLATION', @pIP ,@realmoney,'TOURNAMENT CANCELLED','CASH') DELETE FROM tblRegistration WHERE nickname=@username and skinid=@skinid END ELSE BEGIN UPDATE tblUsers SET PlayMoney=PlayMoney + @Credit WHERE nickname=@username and skinid=@skinid DELETE FROM tblRegistration WHERE nickname=@username and skinid=@skinid END FETCH NEXT FROM CANCREG_CUR INTO @username,@Credit,@TicketNo END CLOSE CANCREG_CUR DEALLOCATE CANCREG_CUR END
Nilesh Patil Kolhapur
просто преобразуйте его в string boss и выполните