Results 1 to 11 of 11

Thread: [vb.net expr]send text onchange form <---> class --> update dgv

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2006
    Posts
    103

    Question [vb.net expr]send text onchange form <---> class --> update dgv

    I have a question and hope it's possible

    i have a form with a datagridview with textboxes above (see picture).
    What i want to do is from the moment i type a character in a textbox he start searching in the datagridview. With other words... he has to look for it on textChanged.

    i taught i make in my form a function

    VB Code:
    1. Function selectCustomer() As String
    2.         Dim i, t As Integer
    3.         Dim searchstring As String
    4.         Dim string1, string2, string3 As String
    5.         Dim name, lastname, address, zipcode, city, speciality, phone As String
    6.  
    7.         name = Me.txtSearchCustomerName.Text
    8.         lastname = Me.txtSearchCustomerLastname.Text
    9.         address = Me.txtSearchCustomerAddress.Text
    10.         zipcode = Me.txtSearchCustomerZipcode.Text
    11.         city = Me.txtSearchCustomerCity.Text
    12.         speciality = Me.cmbSearchCustomerSpeciality.Text
    13.         phone = Me.txtSearchCustomerTelephone.Text
    14.  
    15.  
    16.         string1 = "SELECT ... FROM ... "
    17.         string3 = ";"
    18.         string2 = String.Concat("WHERE ", strCustomerName, " LIKE '%", name, "%' AND '", strCustomerLastName, "LIKE '%", lastname, "%'etc...")
    19.  
    20.         searchstring = String.Concat(string1, string2, string3)
    21.         Return searchstring
    22.     End Function

    from the moment the text in a textbox change, it has to send (don't know how) the string (searchstring) to the class data_function where it makes a connection with the databank, get the data from the databank and send it back to the form and update the datagridview. And that for all the characters i type in all the textboxes (+1 combobox) i have above the datagridview.

    is this possible and how...
    (if it is not a problem for you, please explain with some code...)

    i hope its clear for you

    greetz freakyme
    Attached Images Attached Images  
    Last edited by freakyme; Mar 12th, 2007 at 04:37 AM.
    VB.NET 2005 n00b

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