Results 1 to 3 of 3

Thread: datatable select not found [2005]

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2005
    Posts
    81

    datatable select not found [2005]

    hi all.i would like to know, why datatable.select(condition), sometimes it found records, but sometimes not found a record.
    here this is an example of my datatable:

    ID itemID
    1 2
    1 3
    1 1
    1 4
    1 2 I don't want this record
    2 3
    2 4
    2 1
    2 3 I don't want this record too.

    I would like to insert without a duplicate value.

    and here is my datatable.select function(purpose of the function is to search)

    Code:
        Private Function SearchDataTable(ByVal dt As DataTable, ByVal condition As String) As Integer
            Dim ReturnValue As Integer
            ReturnValue = dt.Select(condition).Length
            Return ReturnValue
        End Function
    
        Private sub cmd_Click()
               if searchdatatable(dt, "id=" & id & " and ItemID=" & txtItemID.text)=0 then
                 ........
                 ........
                 ........
               End If
              ........
              ........
              ........
        End Sub

    anyidea please, many thank for your help.

  2. #2
    Fanatic Member MetalKid's Avatar
    Join Date
    Aug 2005
    Location
    Green Bay, Wisconsin
    Posts
    534

    Re: datatable select not found [2005]

    When you do your SELECT, put SELECT Distinct
    If your problem is solved, please use the Mark Thread As Resolved under Thread Tools!

    Show Appreciation. Rate Posts!

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2005
    Posts
    81

    Re: datatable select not found [2005]

    I would like to insert records without dublicate value. The items from above, It is a result from my insert, because my search function not work well. so more please?

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