开发者

Datatable constraints with C#

开发者 https://www.devze.com 2023-01-10 01:35 出处:网络
I have a Data table whose primary key should be case sensitive. i.e. \'abc\' and \'ABC\' should be consid开发者_C百科ered unique. Hence I have enabled CaseSensitive property of a datatable to true. Bu

I have a Data table whose primary key should be case sensitive. i.e. 'abc' and 'ABC' should be consid开发者_C百科ered unique. Hence I have enabled CaseSensitive property of a datatable to true. But the performance is degraded as I am loading 6000+ items in the table. Is there any way that I can disable the casesensitivity after loading the data or any other way to implement this?


The fast solution: don't touch case sensitivity and maybe is better to add some field to the primary key (or use other). It is a good practice to separate "business keys" data and database data integrity keys.

Sample: UserId (PK) and UserLogin (business key also unique)

0

精彩评论

暂无评论...
验证码 换一张
取 消