I have the image data stored in a SQL Server database table. This is my table structure
create table userimages
(ID integer identity(1,1),
boardingpass varbinary(max));
go
I have created a stored procedure which returns back the image using the out parameter after checking if the user is a valid user or not
alter procedure return_userimage(@firstname char(100) , @lastname char(100), @imagedata varbinary(max) out)
as
begin
declare @result int
exec @result = usp_validatuser @firstname, @lastname
if(@result = 1)
begin
declare @userid int
select @userid = ID
from tbl_UserInformation
where FirstName = @firstname and LastName = @lastname
select @imagedata = boardingpass
from userimages
where ID = @userid
end
else
begin
return 0
end
end
I want to retrieve back the image and display it using ASP image control . Please guide with the code required to call the stored procedure and display the image using c#,ASP.
Thanks