Results 1 to 7 of 7

Thread: [2005] Search

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2007
    Posts
    258

    [2005] Search

    Hi how do i make a Search txtbox?

    anyone help me with the codes?

    ex. my table name is EmployeeProfile and i want to search the employeeID's in that table

  2. #2
    Frenzied Member stimbo's Avatar
    Join Date
    Jun 2006
    Location
    UK
    Posts
    1,739

    Re: [2005] Search

    What have you got so far?
    Stim

    Free VB.NET Book Chapter
    Visual Basic 2005 Cookbook Sample Chapter

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2007
    Posts
    258

    Re: [2005] Search

    a textbox named txtSearch and an a button, basically nothing yet on codes pretty clueless thanx

  4. #4
    Frenzied Member stimbo's Avatar
    Join Date
    Jun 2006
    Location
    UK
    Posts
    1,739

    Re: [2005] Search

    I suggest you search the forums first. There are literally hundreds of examples on SQL and searching for records. Here's an example in the code bank. I think you will probably be most interested in example 2.

    http://www.vbforums.com/showthread.php?t=469872
    Stim

    Free VB.NET Book Chapter
    Visual Basic 2005 Cookbook Sample Chapter

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2007
    Posts
    258

    Re: [2005] Search

    hmm what i want t odo is search an employee ID then when i click search btn, it displays in the form including all the details, i already have everything except for the search so instead of using a button next,previous,last,first.. i want a search txtbox so thjat ill just be inputting the id number of the mployee view his/her data

  6. #6
    Frenzied Member stimbo's Avatar
    Join Date
    Jun 2006
    Location
    UK
    Posts
    1,739

    Re: [2005] Search

    So you have all the SQL code already??

    Well then, you would add the search as a parameter. When you declare your SQL search term you would just add this on the WHERE clause:

    WHERE employeeID = @Search

    Then where you have declared your SQL select command you add it as a parameter (this assumes sqlSel has been delcared as a SQL statement):

    vb Code:
    1. sqlSel.Parameters.AddWithValue("@Search", Me.Textbox1.text)

    Perform your search as you would do.
    Stim

    Free VB.NET Book Chapter
    Visual Basic 2005 Cookbook Sample Chapter

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2007
    Posts
    258

    Re: [2005] Search

    i have everything except ALL the codes for inputting a search function txtbox

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