How to Query a database to return results to the neccessary textboxes

Posted on 2005-04-08
Last Modified: 2010-04-07
Good Morning All--

I am new to and I am trying to complete my application here for work. I need some help with my query page. What I want to do is this, I have a field where the user inputs there vendor number, hits the query button, I then want it to return the name, address, state, zip that we currently have for their vendor number in our database. These values will return to the appropriate textboxes which I want to be "Read Only". I know I need to code a function in, then I need to code the query button in. Can someone help me?

If you need some more information let me know, Oh yeah I am doing this in VB.

Thanks much!
Question by:maybewecan
    LVL 10

    Expert Comment

    1. Download data access application blocks from microsoft.
    2. Reference the dll.

    then use the sqlhelper.executereader to get the strings

        Public Function traeridclubxdeporte(ByVal posicionequipo1 As Int32, ByVal iddeporte As Int32) As string()
            sqlconnsirde = connbasica.connsirde()
            Dim arParams(2) As SqlParameter
            arParams(0) = New SqlParameter("@posicion", posicionequipo1)
            arParams(1) = New SqlParameter("@iddeporte", iddeporte)
            Dim dr As SqlDataReader = SqlHelper.ExecuteReader(sqlconnsirde, CommandType.Text, "select idclubxdeporte from tblclubesxdeporte where iddeporte=@iddeporte and posicion=@posicion", arParams)

    dim res as string = new string(1){}
            Dim idclubxdeporte As Int32 = dr.GetInt32(0)  ' 0 position based
            Return res
        End Function

    then in yoiur sub or method
          Dim res  as string() = new string{}

    res= traerdeportedeprogramaespecial(idgrupoprogramaespecial)

    textbox1.text = res(0)

    LVL 5

    Accepted Solution

    See this example for version)
    LVL 10

    Expert Comment

    This is not fair He didnt gave you  nothing

    He gave you a link to sarch for it I gave you code.  This is going to be posted on support.

    Author Comment

    Yes, you gave me code but he gave me a better option for me to understand. Stop Whinning!!!!

    Author Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on could not pull conte…
    ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now