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. General Programming
  3. .NET (Core and Framework)
  4. DataView.Select Syntax

DataView.Select Syntax

Scheduled Pinned Locked Moved .NET (Core and Framework)
question
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.
  • D Offline
    D Offline
    Defender NF
    wrote on last edited by
    #1

    Hello Everyone For the DataView.Select Methode i use like this string as a DataColumn.Expression: string StatSelect = String.Format(ProductName LIKE '%{0}%'", SearchTextBox.Text); Productname is the Column where to search, but what is if i wanna search for the string in the whole table ( all columns) ? Thanks in Advance Jacko

    P P 2 Replies Last reply
    0
    • D Defender NF

      Hello Everyone For the DataView.Select Methode i use like this string as a DataColumn.Expression: string StatSelect = String.Format(ProductName LIKE '%{0}%'", SearchTextBox.Text); Productname is the Column where to search, but what is if i wanna search for the string in the whole table ( all columns) ? Thanks in Advance Jacko

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      I would assume that you could simply append them to this using an OR condition.

      I'm not a stalker, I just know things. Oh by the way, you're out of milk.

      Forgive your enemies - it messes with their heads

      My blog | My articles | MoXAML PowerToys | Onyx

      D 1 Reply Last reply
      0
      • P Pete OHanlon

        I would assume that you could simply append them to this using an OR condition.

        I'm not a stalker, I just know things. Oh by the way, you're out of milk.

        Forgive your enemies - it messes with their heads

        My blog | My articles | MoXAML PowerToys | Onyx

        D Offline
        D Offline
        Defender NF
        wrote on last edited by
        #3

        there is not another solution? since i dont know always wich datatables user is calling and this is a little bit strange query? string StatSelect = String.Format(ProductName LIKE '%{0}%'" OR ProductName LIKE '%{0}%'" OR etc....., SearchTextBox.Text); tought for something like: string StatSelect = String.Format('%' LIKE '%{0}%'", SearchTextBox.Text); ?

        1 Reply Last reply
        0
        • D Defender NF

          Hello Everyone For the DataView.Select Methode i use like this string as a DataColumn.Expression: string StatSelect = String.Format(ProductName LIKE '%{0}%'", SearchTextBox.Text); Productname is the Column where to search, but what is if i wanna search for the string in the whole table ( all columns) ? Thanks in Advance Jacko

          P Offline
          P Offline
          Prasanta_Prince
          wrote on last edited by
          #4

          sortexp = "Name LIKE '" + SearchFor + "%'";

          dv.RowFilter = sortexp;

          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