locked
Entity Framework asking for parameters to exclusively match database parameters RRS feed

  • Question

  • User2141129838 posted
    ALTER PROCEDURE [dbo].[usp_InsertNewMeeting]  
    	@roomId int,
    	@startDateTime datetime,
    	@endDateTime datetime,
    	@bookedBy varchar(50),
    	@contact varchar(50),
    	@title varchar(100),
    	@notes varchar(300),
    	@startDate date,
    	@endDate date,
    	@meetingTypeId int,
    	@meetingTypeComment varchar(50) = NULL,
    	@fileName varchar(255) = NULL,
    	@fileData varbinary(max) = NULL,
    	@mimeType varchar(50) = NULL
    	
    AS
    BEGIN
    	SET NOCOUNT ON;
    
    	Declare @meetingsId int;
    	Declare @seriesId int;
    	Declare @fileId int = NULL;
    
    	IF @fileName IS NOT NULL
    		BEGIN
    			INSERT INTO [FileSystem].[file].[File] ([Section], [FileName], [MimeType], [BLOB], [CreatedBy], [ModifiedBy])
    			VALUES ('Meeting Booking System', @fileName, @mimeType, @fileData, replace(suser_sname(),'BFG\',''), replace(suser_sname(),'BFG\',''));
    			SET @fileId = SCOPE_IDENTITY();
    		END
    
    	INSERT INTO [dbo].[Series] (BookedBy, ContactPerson, Title, Notes, StartDate, EndDate, FileID, MeetingTypeID, MeetingTypeComment)
    	VALUES (@bookedBy, @contact, @title, @notes, @startDate, @endDate, @fileId, @meetingTypeId, @meetingTypeComment);
    	SET @seriesId = SCOPE_IDENTITY();
    
    	INSERT INTO [dbo].[Meeting] (RoomID, SeriesID, StartDateTime, EndDateTime)
    	VALUES (@roomId, @seriesId, @startDateTime, @endDateTime);
    	SET @meetingsId = SCOPE_IDENTITY();
    
    END

    That is my stored proc, when I run my code it is spitting out an error about parameters needing to match database parameters. I am not sure what that means, does it mean that the types need to match? So when I put the form data in the sqlParameters do they need to be int, datetime, string etc..?


    Sunday, August 16, 2015 10:56 PM

All replies

  • User-821857111 posted

    Can you post the actual error message?

    Monday, August 17, 2015 8:27 AM