Datatable hit case sensitive unique constraint when add new row

泪湿孤枕 提交于 2019-12-13 03:43:34

问题


I hit unique constraint when add new row in datatable.

my unique field is ID.

ID

==

abc

ABC

How to disable the sensitive case checking in datatable.

I use datatable.casesensitive = false before not work for me.


回答1:


Use CaseSensitive = true before setting the PrimaryKey property on the datatable and it will be case-sensitive. I had the same problem and this is how I fixed it.




回答2:


You need to rebuild your unique constraint like this:

create unique index uk_MyTable_ID on MyTable(upper(ID));


来源:https://stackoverflow.com/questions/19584916/datatable-hit-case-sensitive-unique-constraint-when-add-new-row

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!