I am trying to make a query in which I pass a text column that contains an integer as text in Int32. Here's the request:
SELECT VALUE t FROM MyEntities AS t WHERE CAST(t.TextColumn AS Edm.Int32) > 5
However, I get a System.Data.EntitySqlException message with the following message:
Could not find type "Edm.Int32". Be sure to load the necessary schemas and import the correct names. Next to the type name, row 1, column 75.
According to MSDN , Edm.Int32 must be a valid type.
Does anyone know what is wrong?
Edit:
After some trial and error, I found that the following works:
SELECT VALUE t FROM MyEntities AS t WHERE CAST(t.TextColumn AS System.Int32) > 5
Are MSDN examples wrong? I feel that something is missing here ...
source share