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. C#
  4. BindingSource question, help me

BindingSource question, help me

Scheduled Pinned Locked Moved C#
databasehelpquestion
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.
  • P Offline
    P Offline
    phantanagu
    wrote on last edited by
    #1

    Hi, I want to filter the productID that starts with "MDF", so I use bindingsource1.filter = "productID like 'MDF%'" (look like sql query), but it's not working. Somebody could correct the code will be appreciated. Thanks in advance.

    It seem to be a solution or an answer.

    K K 2 Replies Last reply
    0
    • P phantanagu

      Hi, I want to filter the productID that starts with "MDF", so I use bindingsource1.filter = "productID like 'MDF%'" (look like sql query), but it's not working. Somebody could correct the code will be appreciated. Thanks in advance.

      It seem to be a solution or an answer.

      K Offline
      K Offline
      Keshav V Kamat 0
      wrote on last edited by
      #2

      Do you want a sql query for this? if so then here it is

      select fieldNames/* from tableName where productID like 'MDF%';

      This would select all/several fields from the table name where the productID begins with MDF% You can use connection/command/dataReader accordingly depending upon the database you are using.

      Keshav Kamat :) India

      P 1 Reply Last reply
      0
      • P phantanagu

        Hi, I want to filter the productID that starts with "MDF", so I use bindingsource1.filter = "productID like 'MDF%'" (look like sql query), but it's not working. Somebody could correct the code will be appreciated. Thanks in advance.

        It seem to be a solution or an answer.

        K Offline
        K Offline
        K Vikas
        wrote on last edited by
        #3

        It is working on my system. Hope that u r resetting the datasource of DataGridView after applying the filter on bindingsource1.

        1 Reply Last reply
        0
        • K Keshav V Kamat 0

          Do you want a sql query for this? if so then here it is

          select fieldNames/* from tableName where productID like 'MDF%';

          This would select all/several fields from the table name where the productID begins with MDF% You can use connection/command/dataReader accordingly depending upon the database you are using.

          Keshav Kamat :) India

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

          It will be OK if I use sql query to filter the productID begins with MDF. But, what I need is bindingsource1.filter = "productID like 'MDF%'" is correct or not ? I mean that "productID like 'MDF%'" string is correct or not. If not, How must I make it correct ?

          It seem to be a solution or an answer.

          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