Results 1 to 4 of 4

Thread: [2005] Select not returning correct rows

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2006
    Location
    Manchester, England
    Posts
    255

    [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)
    At home - VB.NET 2005/2008 Express, Visual Web Developer 2005 Express
    At work - VS 2008 Standard (VB)
    .NET 2.0/3.5


    Visual Studio Express Learning Centre | How do I videos | MSDN VB Express Forum | MSDN VB Developer Centre

  2. #2
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092

    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.

  3. #3
    Frenzied Member axion_sa's Avatar
    Join Date
    Jan 2002
    Location
    Joburg, RSA
    Posts
    1,724

    Re: [2005] Select not returning correct rows

    Set the CaseSensitive property on the DataTable to "true"

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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
  •  



Click Here to Expand Forum to Full Width