Results 1 to 4 of 4

Thread: Search for a string in an mdb column

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2013
    Posts
    200

    Search for a string in an mdb column

    Hi, my app is using an mdb database and one of my form is holding a dataset, a databindingsource and a tableadapter. I want to search if the column "product_name" has a cell with some value (for example: LENOVO Z5070 İ5-4210U 8G 1TB+8G SSHD 15.6")

    Is there a simple way to do this?

  2. #2
    Hyperactive Member
    Join Date
    Sep 2014
    Posts
    404

    Re: Search for a string in an mdb column

    look into DataSet.Filter

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 2013
    Posts
    200

    Re: Search for a string in an mdb column

    Thanks for the reply. I searched for "DataSet.Filter" but couldn't find what I was looking for. Could you give me example code?

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Search for a string in an mdb column

    On the DataTable, there is a DefaultView property, which contains a RowFilter property that you can set similar to a SQL WHERE clause.
    http://stackoverflow.com/questions/5...ing-datasource
    There is also this which takes a slightly longer route by skipping the devault view and creating a new one and assigning it to the DGV each time.
    http://vb.net-informations.com/datag...dview_sort.htm

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Tags for this Thread

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