search button

  • 12 years ago

    Hi, im doing a project using vb.net and i want to use a search button to find say a suppliername. i have a table called supplier and instead of using a combobox with the primary key as the supplierid i want to use a search button and search for there name if thats possible. The combobox fills all the text box with the details of that supplier. an example of the cvode i am using to fill these boxes are below. any help would be greatful. Smiley Face [:)]

    Public Sub FillSupplierDetails()

    'declare data row

    Dim objRow As DataRow

    objRow = objDataSet.Tables(

    "Supplier").Rows.Find(cbosuppliers.SelectedItem.ToString)

    'link data between database and form

    txtsuppliername.Text = objRow.Item(

    "Supplier_Name")

    txtaddress.Text = objRow.Item(

    "Address")

    txtaddress2.Text = objRow.Item(

    "Address2")

    txtaddress3.Text = objRow.Item(

    "Address3")

    txtcontact.Text = objRow.Item(

    "Contact_Number")

    txtemail.Text = objRow.Item(

    "Email_Address")

    txtamountdue.Text = objRow.Item(

    "AmountDue")

     

     

    End Sub

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.” - Brian Kernighan