Ignoring accents in SQL Server using LINQ to SQL

前端 未结 4 1877
梦谈多话
梦谈多话 2020-12-17 19:20

How can I ignore accents (like ´, `, ~) in queries made to a SQL Server database using LINQ to SQL?

UPDATE:

Still haven\'t figured out how t

4条回答
  •  南笙
    南笙 (楼主)
    2020-12-17 20:04

    See the following answer:

    LINQ Where Ignore Accentuation and Case

    Basically you need to alter the field type in SQL Server, e.g.

    ALTER TABLE People ALTER COLUMN Name [varchar](100) COLLATE SQL_Latin1_General_CP1_CI_AI
    

    There does not seem to be a way to do this using LINQ, apart from calling a custom method to remove diacritics (which would not be performant).

提交回复
热议问题