ALTER Procedure [library].[updateisbn]
(
@Schoolid nvarchar(150),
@bookid int,
@id nvarchar(max),
@isbn nvarchar(max),
@shelfno nvarchar(max),
@msg nvarchar(max) output,
@msg1 nvarchar(max) output
)
as
begin
declare @pos int,@I int, @number int, @shelfcount int, @Spos int,@count int,@c nvarchar(max),@Pos1 int,@ii nvarchar(max),@s nvarchar(max),@Pos2 int
set @Spos=1
set @msg=''
set @I=1
set @count= len(@isbn)-len(REPLACE(@isbn,',',''))
while(@I<=@count)
begin
SET @Pos = CHARINDEX(',', @isbn, 1)
SET @Pos1=CHARINDEX(',',@id,1)
SET @Pos2=CHARINDEX(',',@shelfno,1)
set @c = substring(@isbn,@Spos,@Pos-1)
set @ii= substring(@id,@Spos,@Pos1-1)
set @s=substring(@shelfno,@Spos,@Pos2-1)
set @number =(select count(isbn) from library.bookISBNno where id=@ii and isbn=@c)
if(@number=0)
begin
set @shelfcount =(select count(shelfNo) from library.bookISBNno where isbn=@c and shelfNo=@s)
if(@shelfcount=0)
begin
Update library.bookisbnno set isbn=@c,shelfno=@s where id=@ii and bookid=@bookid and schoolid=@Schoolid
set @msg=@msg+''+@c+'Updated,'
set @msg1=@msg+''+''+@s +''+'Updated,'
end
else
begin
Update library.bookisbnno set isbn=@c where id=@ii and bookid=@bookid and schoolid=@Schoolid
set @msg=@msg+''+@c+'Updated,'
set @msg1=@msg+''+''+@s +''+'Exist,'
end
end
else
begin
set @shelfcount =(select count(shelfNo) from library.bookISBNno where isbn=@c and shelfNo=@s)
if(@shelfcount=0)
begin
Update library.bookisbnno set shelfno=@s where id=@ii and bookid=@bookid and schoolid=@Schoolid
set @msg=@msg+''+@c+'Exist,'
set @msg1=@msg+''+''+@s +''+'Updated,'
end
else
begin
set @msg=@msg+''+@c+'Exist,'
set @msg1=@msg+''+''+@s +''+'Exist,'
end
end
set @isbn= stuff(@isbn, @Spos, @Pos,'')
set @id=stuff(@id,@Spos,@Pos1,'')
set @shelfno=stuff(@shelfno,@Spos,@Pos2,'')
set @I=@I+1
end
end
i am using this procedure for two output. procedure give the output but .. how can i use this in my C# program.