Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Select Statement

Status
Not open for further replies.

jgaylord

IS-IT--Management
Apr 17, 2006
11
US
If I Select * from a Database...
How do I place the fields into TextBoxes?

Instead of selecting all should I specify each field or something? Please Explain...
 
Its always better to select the fields instead of wild carding them all from a sql standpoint.

as you loop through the records

datareader(dr) for example

me.textbox1.text = dr("mycolumn1")
me.textbox2.text = dr("mycolumn2")
 
if you do wildcard, you can also use column index to tell which column you want:

me.textbox1.text = dr(0) 'First Column
me.textbox1.text = dr(1) 'Second Column

That can be useful if you are pulling a variable number of columns (generic code setup - looping through all columns by count - 1).

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB/Access Programmer
 
Awesome! this worked Great!
Thank You SO MUCH!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top