Tutorial - GraphicalText Part 3
24 Pages
English

Tutorial - GraphicalText Part 3

-

Downloading requires you to have access to the YouScribe library
Learn all about the services we offer

Description

VBTrain.Net Graphical Text Object Part 3: Practical Guide TUTORIAL BY Dr. med. Cecil Cheah 03 March 2004 Page 1 of 24 Table of Content PRACTICAL USE OF THE GRAPHICAL TEXT OBJECT 3 Data Binding 3 Create a database 3 Binding a Window Form to the Database 6 Fetching the names randomly 17 Make the text color changes as we randomly generates the text 21 HOW TO CONTACT ME 24 Page 2 of 24 Practical Use of the Graphical Text Object. Data Binding One of the attractions of the graphical text object is its ability to bind to data and change its text accordingly. So I would show you how to bind the graphical text object to a database and change its text. Create a database. Start MS Access. Create a new blank database and name it as myGraphicalText.mdb and then save it in the same folder as your project file. Under Tables, click the New button. Page 3 of 24 Select “Design View” and click OK. Add the two field names and data type as shown. Page 4 of 24 Click the view button in the toolbar and change it to Datasheet View, You will now be asked to save the table. Click Yes and enter “myName” as the table name. Click OK If you did not create a Primary Key, MS Access will ask you if you want to create it now. Answer Yes. Now you are in the DataSheet View. Start giving it some name. I have entered 10 names. Page 5 of 24 Once you are done, close MS Access and return to our project. Binding a Window Form to ...

Subjects

Informations

Published by
Reads 15
Language English











VBTrain.Net Graphical Text Object

Part 3: Practical Guide




TUTORIAL BY Dr. med. Cecil Cheah

03 March 2004

Page 1 of 24 Table of Content
PRACTICAL USE OF THE GRAPHICAL TEXT OBJECT 3
Data Binding 3
Create a database 3
Binding a Window Form to the Database 6
Fetching the names randomly 17
Make the text color changes as we randomly generates the text 21
HOW TO CONTACT ME 24
Page 2 of 24 Practical Use of the Graphical Text Object.
Data Binding
One of the attractions of the graphical text object is its ability to bind to data and change its text
accordingly. So I would show you how to bind the graphical text object to a database and change
its text.
Create a database.
Start MS Access. Create a new blank database and name it as myGraphicalText.mdb and then save
it in the same folder as your project file.


Under Tables, click the New button.
Page 3 of 24
Select “Design View” and click OK.

Add the two field names and data type as shown.
Page 4 of 24
Click the view button in the toolbar and change it to Datasheet View,

You will now be asked to save the table.

Click Yes and enter “myName” as the table name. Click OK
If you did not create a Primary Key, MS Access will ask you if you want to create it now. Answer
Yes.
Now you are in the DataSheet View. Start giving it some name. I have entered 10 names.
Page 5 of 24
Once you are done, close MS Access and return to our project.
Binding a Window Form to the Database.
From the menu, select Tools, Connect to Database.

Click on the Provider Tab and select the Microsoft Jet 4.0 OLE DB Provider.
Page 6 of 24

Click Next. In the Select Database Name, click the … Box and locate our myGraphicalText.mdb.
Page 7 of 24

Click Open.
Page 8 of 24
Click on the Text Connection button.
Page 9 of 24
If you have been following what I have written, you should see the dialog box as shown below.

Click OK, and OK again to close the Data Link Properties Window. You have now succeeded in
linking the Visual Basic .NET to the database.
If you now look at the Server Explorer window, you should see our database has been connected.


Page 10 of 24