Entity Framework: The parameterized query expects the parameter which was not supplied


This question is probably something simple because of my unfamiliarity with Entity Framework. I am debugging someone else's code.

Dim quoteSql As String = $" SELECT TOP 1 * FROM HomeDWQuote WHERE RecID = @QuoteID ORDER BY RecID DESC"

Using db As New Data.Auto.CRSContext()

     Dim dwQuotes = db.HomeDWQuotes.FromSqlRaw(quoteSql, {New SqlParameter("@QuoteID", quoteId)}).ToList()

Is giving me this error:

(0x80131904): The parameterized query '
(@QuoteID nvarchar(4000)) SELECT TOP 1 * FROM HomeDWQuote WHERE '
 expects the parameter '@QuoteID', which was not supplied.

This question has been asked several other times but this question is different because it is using FromSqlRaw() which I am not familiar with.


0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0