|
-
Dec 17th, 2007, 08:36 AM
#1
Thread Starter
Addicted Member
[2005] Select not returning correct rows
I am writing some code that interrogates a database of error codes, and areas where the error code may occur so that I may provide the user with common problems and solutions to the error.
For example, I have an error code, "abc" which could occur in Module1, Module3 and Module7.
What I am finding is that if I also have an error code "ABC" (i.e. uppercase), when I run the following select command, it returns DataRows for "abc" and "ABC".
If I select "abc" from my DropDownList, how do I get it to only select "abc", and not "abc" and "ABC"?
Code:
strExpression = "Code = '" & Me.DropDownList2.Text & "' and Module = '" & strModuleCode & "'"
Dim foundrows() As DataRow
foundrows = dsDataSet.Tables(2).Select(strExpression)
-
Dec 17th, 2007, 08:49 AM
#2
Re: [2005] Select not returning correct rows
You need to make the field in the database case sensitive.
I don't know what database you are using but I'll presume it's SQL server in which case you need to enter the collation menu for that field and set it to case sensitive.
-
Dec 17th, 2007, 02:03 PM
#3
Re: [2005] Select not returning correct rows
Set the CaseSensitive property on the DataTable to "true"
-
Dec 18th, 2007, 07:15 AM
#4
Re: [2005] Select not returning correct rows
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|