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. sqldatasource

sqldatasource

Scheduled Pinned Locked Moved ASP.NET
help
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.
  • Y Offline
    Y Offline
    y_mmohd
    wrote on last edited by
    #1

    i'm using sqldatasource in order to search a table item with the column name. I want to search Name column for any word containing any letter found in the text box control. I tried to write the following: SELECT Name, Email FROM Item WHERE CONTAINS (Name , @Name) The following error appears: Cannot use a CONTAINS or FREETEXT predicate on table or indexed view 'Item' because it is not full-text indexed. could you please help me. thanks

    A V 2 Replies Last reply
    0
    • Y y_mmohd

      i'm using sqldatasource in order to search a table item with the column name. I want to search Name column for any word containing any letter found in the text box control. I tried to write the following: SELECT Name, Email FROM Item WHERE CONTAINS (Name , @Name) The following error appears: Cannot use a CONTAINS or FREETEXT predicate on table or indexed view 'Item' because it is not full-text indexed. could you please help me. thanks

      A Offline
      A Offline
      Ashfield
      wrote on last edited by
      #2

      You need to use LIKE

      SELECT @Name = '%' + @Name + '%'
      SELECT Name, Email FROM Item WHERE Name like @Name

      Bob Ashfield Consultants Ltd

      Y 1 Reply Last reply
      0
      • Y y_mmohd

        i'm using sqldatasource in order to search a table item with the column name. I want to search Name column for any word containing any letter found in the text box control. I tried to write the following: SELECT Name, Email FROM Item WHERE CONTAINS (Name , @Name) The following error appears: Cannot use a CONTAINS or FREETEXT predicate on table or indexed view 'Item' because it is not full-text indexed. could you please help me. thanks

        V Offline
        V Offline
        Vimalsoft Pty Ltd
        wrote on last edited by
        #3

        Are you using OLEDB or SQL, there are Some SQL Functions that are not Available in OLEDB like you cant substring in OLEDB instead you MID.

        SELECT Name, Email FROM Item
        WHERE Name like '%@Name%'

        Hope this Helps

        Vuyiswa Maseko, Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding VB.NET/SQL7/2000/2005 http://vuyiswamb.007ihost.com http://Ecadre.007ihost.com vuyiswam@tshwane.gov.za

        1 Reply Last reply
        0
        • A Ashfield

          You need to use LIKE

          SELECT @Name = '%' + @Name + '%'
          SELECT Name, Email FROM Item WHERE Name like @Name

          Bob Ashfield Consultants Ltd

          Y Offline
          Y Offline
          y_mmohd
          wrote on last edited by
          #4

          It is working, Thanks for help Bob Regards,

          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