Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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??

 

 

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

  • *Experts*
Posted

Why do you need the line:

myds.Tables("Staff").DefaultView.Sort = "FirstName"

 

?

 

-ner

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
  • 5 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...