开发者

Datatable constraints with C#

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜