borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (MSHFlexGrid Date Format ...)Next Topic (MSDE) New Topic New Poll Post Reply
AndreaVB Forum : Database : sql query in VB Direct code
Poster Message
Ghobashi
Level: Sage


Registered: 28-02-2003
Posts: 61

icon sql query in VB Direct code

Please I want to know can I join the tools like text box, Label, List, combo box and data grid with sql statements in direct code
e.g if I want to display data from database in one of the previous tools how can I get it

____________________________
with Respect

____________________________
Attached:
Try.zip 2 KB (Downloads: 3)

15-07-2006 at 06:00 PM
View Profile Send Email to User Show All Posts | Quote Reply
GeoffS
Level: VB Lord


Registered: 29-09-2004
Posts: 536
icon Re: sql query in VB Direct code

Hi,
You can bind the controls to your Recordset object :

Set Text1.DataSource = Rscn
Text1.DataField = "name_of_field_to_display"

Create the Recordset in your Form_Load Event rather than the Command1_Click, then bind the controls and set the Recordset to the beginning (Rscn.MoveFirst). Then if you use the Command1_Click to move forward through the Recordset (Rscn.MoveNext) you will see the contents of your controls change. You could put a second button to move back (Rscn.MovePrevious).


____________________________
multi-tasking - the ability to hang more than one app. at the same time.

20-07-2006 at 07:58 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Database : sql query in VB Direct code
Previous Topic (MSHFlexGrid Date Format ...)Next Topic (MSDE) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder