bind query results to a textbox

Posted on 2006-03-27
Last Modified: 2012-05-05
I have a query which runs on my asp page to retrive a row of data.  I would like to write out the information to textboxes. How can I do that please.

Sub Page_Load()
      If Not IsPostBack Then
      End If
End Sub

Sub BindData()
'dim currentdate as date
dim id = (request.params("recordid"))

      objCmd.CommandText = "select timein, timeout from employeehours where recordid = 24"

objCmd.Connection = objConn
objRdr = objCmd.ExecuteReader()

End Sub
Question by:running32
    LVL 9

    Accepted Solution

    after your execute reader statement..

    while objReader.Read
     txtbox2.text=objReader(1)        //You will do this as per the number of columns your query results..

    end while


    Author Comment

    I get objreader not declared.  Thanks

    Author Comment

    Sorry go it, great, thanks

    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

    In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
    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…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    737 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

    22 Experts available now in Live!

    Get 1:1 Help Now