Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

bind query results to a textbox

Posted on 2006-03-27
3
Medium Priority
?
231 Views
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
            BindData()
      End If
End Sub

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

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

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


End Sub
0
Comment
Question by:running32
  • 2
3 Comments
 
LVL 9

Accepted Solution

by:
Raju Srivatsavaye earned 2000 total points
ID: 16301418
after your execute reader statement..

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

end while

objReader.Close()
objConn.Close
0
 

Author Comment

by:running32
ID: 16301738
I get objreader not declared.  Thanks
0
 

Author Comment

by:running32
ID: 16301754
Sorry go it, great, thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 www.johnchapman.name could not pull conte…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Loops Section Overview
Suggested Courses
Course of the Month10 days, 14 hours left to enroll

571 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