return values without sorting

fj8283888

Member
Joined
Sep 11, 2004
Messages
14
Hi,
The following code is to find the record in the database, I have a question to ask that, this function will do the sorting before find the record, the problem is I want to keep the order as it shows in database. is it possible to find the record without sorting??


Code:
 Public Function SearchUserName(ByVal test3 As String, ByVal coltosearch As String) As Integer


        If Not myds Is Nothing Then
            If (myds.Tables.Count > 0) Then
                myds.Tables("Staff").DefaultView.Sort = "FirstName"
                Return myds.Tables("Staff").DefaultView.Find(test3)

            Else
                Return -1
            End If
        Else
            Return -1
        End If
    End Function
Thanks,
fj8283888
 
Find searchs on the Sort field.

Whichever field you sort by is the field the .Find uses to search on.
 
Back
Top