|
-
Dec 21st, 2005, 10:26 PM
#1
Thread Starter
New Member
SQL Output to Text Boxes
How do you output the result of an SQL to an Text Box, opposed to Data Grids? My Thread below talks about my problem of implementing the SUM() function to add an column of numbers. I was just wondering how you output the results of an SQL to an Text Box, because maybe I am doing this wrong. Thanks, Working with Access and VB.Net by the way
-
Dec 22nd, 2005, 11:22 AM
#2
Member
Re: SQL Output to Text Boxes
It may not be the "best" way to do it (and it depends on how many textboxes/fields you have), but I have used a DataReader to do this.
VB Code:
txtName.Text = dr("Name")
txtAddr.Text = dr("Address")
-
Dec 22nd, 2005, 03:02 PM
#3
Re: SQL Output to Text Boxes
If it's a simple SUM() or AVG() or COUNT() or some other function that returns a single value, use ExecuteScalar. It'll return just that one value to you.
http://msdn.microsoft.com/library/en...calartopic.asp
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|