By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,515 Members | 1,061 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,515 IT Pros & Developers. It's quick & easy.

How to use select query to populate text box?

P: 3
I want to know that how can we make SELECT * query possible in VB.net and also get the results in textbox??? help me please
Mar 14 '13 #1
Share this Question
Share on Google+
3 Replies


10K+
P: 13,264
What have you tried so far?
Mar 14 '13 #2

P: 3
i even dont know the coding for that :(
Mar 15 '13 #3

P: 5
Expand|Select|Wrap|Line Numbers
  1. vbcon.Open()
  2.             Dim str As String = ""
  3.  
  4.             str = "SELECT * FROM mytablename"
  5.  
  6.  
  7. Dim dbCommand As New SqlCommand(str, vbcon)
  8. Dim dbReader = dbCommand.ExecuteReader
  9.  
  10.  
  11.  While dbReader.Read()
  12.                 textboxtext = dbReader.Item("myvarname")
  13.  End While
  14.             dbReader.Close()
Jun 14 '13 #4

Post your reply

Sign in to post your reply or Sign up for a free account.