EntitySqlException: The syntax of the command argument '@0' is invalid.

dynamic-linq

Question

I'm getting this error when I issue this:

DataContext.DBProjectEntities.Projects.Where(xWhere, parameterList.ToArray)

The command parameter syntax '@0' is not valid. Near line 6, column 37.

  • xWhere is a string containing value "(ProjectStatuses.Any(DepartmentID = @0))"
  • parameterList is Dim parameterList As New List(Of ObjectParameter)

It contains one element with value 1 of type Int32 which corresponds to the type of DepartmentID.

1
0
9/15/2011 5:38:02 PM

Popular Answer

I got it. I was using the dunamic.vb from an external assembly. In my code I had imports statement for that assembly, but I also needed the imports for system.linq.dynamic

0
9/16/2011 1:33:05 PM


Related Questions





Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow