Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Text search from database

Text search from database

Scheduled Pinned Locked Moved ASP.NET
databasecsharpsql-servervisual-studiosysadmin
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    amit2011
    wrote on last edited by
    #1

    i am using Visual Studio 2005 and Sql Server 2000. pl could u tell me how to Search database elements from the given textbox fields so that the comparison is independent of Case senstivity.. hope i made myself clear.. thanx

    M A 2 Replies Last reply
    0
    • A amit2011

      i am using Visual Studio 2005 and Sql Server 2000. pl could u tell me how to Search database elements from the given textbox fields so that the comparison is independent of Case senstivity.. hope i made myself clear.. thanx

      M Offline
      M Offline
      Manas Bhardwaj
      wrote on last edited by
      #2

      Select something from sometable where somefield like '%somevalue%'

      Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

      1 Reply Last reply
      0
      • A amit2011

        i am using Visual Studio 2005 and Sql Server 2000. pl could u tell me how to Search database elements from the given textbox fields so that the comparison is independent of Case senstivity.. hope i made myself clear.. thanx

        A Offline
        A Offline
        amit2011
        wrote on last edited by
        #3

        hey manas.. i dint get u.. i mean to say that in a textbox the value inputed has to be compared with that from database table.and i want that the search must be independent of capitalization of the textbox value. example. if table has "Sunday" then the textbox value "SuNdAy" must also match wid it.. pl explian it in detail,m a bit new to it.. thanx

        R 1 Reply Last reply
        0
        • A amit2011

          hey manas.. i dint get u.. i mean to say that in a textbox the value inputed has to be compared with that from database table.and i want that the search must be independent of capitalization of the textbox value. example. if table has "Sunday" then the textbox value "SuNdAy" must also match wid it.. pl explian it in detail,m a bit new to it.. thanx

          R Offline
          R Offline
          Rutvik Dave
          wrote on last edited by
          #4

          as far as i know, SQL Server is not case sensitive for text comparision, so just compare like select * from t where xyz = 'abc' or select * from t where xyz = 'ABC' both are same. 'Sunday' and 'SUNDAY' are same in SQL Server. or if you want to make sure than you can use either UPPER() or LOWER() i.e. select * from t where upper(xyz) = 'ABC' Also Manas is trying to tell you that if you want to do partial search then use 'Like' with '%' ex. select * from t where Day like 'S%' will return both 'Saturday' and 'Sunday' while select * from t where Day like 'Su%'; will return only 'Sunday' in short % is like * in DOS.

          modified on Tuesday, September 9, 2008 12:48 PM

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups