I am inserting an image file and a sound file in one button click. I am calling two stored procedures for the task. But the problem is first the image is getting saved in the database and then the sound file is overwriting it. The sound file is not getting saved in the cell allocated for it.
The two stored procedures are:
ALTER PROCEDURE [dbo].[InsertImageIntoServiceRequest]
(@ServiceRequestID int,
@FileName nvarchar(150),
@Image varbinary(max))
AS
BEGIN
update ServiceRequest
set ImageFilename=@FileName, [Image]=@Image
where ID=@ServiceRequestID
END
and
ALTER PROCEDURE [dbo].[InsertSoundIntoServiceRequest]
(@ServiceRequestID int,
@FileName nvarchar(150),
@Sound varbinary(max))
AS
BEGIN
update ServiceRequest
set SoundFilename=@FileName, Sound=@Sound
where ID=@ServiceRequestID
END
When I debugged my ASP.net application I found that while saving the sound file the InsertImageIntoServiceRequest
is also getting called and the sound file is overlapping the image file.
Please suggest something.