Results 1 to 3 of 3

Thread: How to search thru DataSet

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2003
    Posts
    110

    How to search thru DataSet

    I have loaded a whole single table in a DataSet

    Now I want to perform search within the DataSet
    which has expressions like..

    "ProductName LIKE 'c%' AND QuantityPerUnit > 100"

    how do i filter the DataSet with such conditions ?
    Anis Bombaywala

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    Code:
           
            Dim row() As DataRow = objPersistData.persistDS.Tables("Pascode").Select("PASCode Like 'blaah'")
    
            NAF = row(0).Item("NAF")
            OBAN = row(0).Item("OBAN")
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    VB Code:
    1. Dim dv as New DataView(ds.Tables("myTable");
    2. dv.RowFilter = "ProductName LIKE 'c%' AND QuantityPerUnit > 100"
    3. dataGrid.DataSource = dv

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