I am able to convert list of unicode strings into Non unicode strings.
Remove N Character (non Unicode support)
-
29-06-2022 - |
Pregunta
I am using EF 4.1 Code First. EF generates a query for the IN clause is :
SELECT Column1
FROM Table1
WHERE Column1 IN (N'ABC',N'XYZ', N'DEF')
The IN clause is generated by using List.Contains() method.
Is there any way so that I can remove unicode values (N character) from in clause ? So the query should look like
SELECT Column1
FROM Table1
WHERE Column1 IN ('ABC','XYZ', 'DEF')
Any help in this regard is appreciated.
Note: I have specified all the column type as mentioned in DB.
Solución 2
Otros consejos
I'm not sure but..
- Check Column1 Type on your EF model (Unicode property) to be set to false.
- Be sure do not apply any string functions like "Trim" or smthng similar. This will convert your db value in a unicode string.
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow