Reputation: 48412
I have an EF 5 app and I'm trying to call a stored procedure which takes a single parameter, as follows:
As you can see, I am supplying a parameter, and it's the correct name. Can anyone tell me where I'm going wrong? The image may be a bit hard to see. The error says:
"Procedure or function 'AddRowToPanelCdClAllData' expects parameter '@SubId' which was not supplied."
The line of code generating the error is as follows:
internal void AddRowToPanelCdClAllData(string subId)
{
this.Database.Database.ExecuteSqlCommand("AddRowToPanelCdClAllData", new SqlParameter("@SubId", subId));
}
The value of 'subId' contains a value and is not null.
Upvotes: 3
Views: 6525
Reputation: 22323
try this:
this.Database.Database.ExecuteSqlCommand("AddRowToPanelCdClAllData @SubId",
new SqlParameter("SubId", subId));
Upvotes: 8