I am able to convert list of unicode strings into Non unicode strings.
Remove N Character (non Unicode support)
-
29-06-2022 - |
Question
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.
Solution 2
OTHER TIPS
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.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow