Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Case insensitivity in datasets causing constraint error

Status
Not open for further replies.

Beeble

Programmer
Jun 12, 2001
7
GB
I have an SQL server 200 table with 4 columns, the first 3 of which are primary key. The table is case sensitive so putting 'A,B,Test,1' in one row and 'A,B,TEST,1' in another is fine as far as sql is concerned. When I create a dataset in visual studio and select the records I get an error saying that the constraints have failed. Using the 'Preview data' wizard shows that it regards the rows above as duplicates. I have specified that the dataset is case-sensitive but cannot get it to work.
Any suggestions would be greatly appreciated.
[ponder]
 
Having spent 2 days searching for this answer I discovered the problem 10 minutes after posting the request. For the information of others here is what I think is a bug in Visual Studio.
Changing the property of the dataset to Case Sensitive = True doesn't do all the work. Searching through the Dataset1.vb code there is an InitClass which still had Me.CaseSensitive = False. Manually changing that to True suddenly fixed the problem.
Hope this maybe helps someone else.
[thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top