Data Form Wizard
Visual Basic also allows us to work with DataBinding with it's built-in feature "Data Form Wizard". We will have a look at how we can create our own data-entry forms with the Data Form Wizard. A Data Form Wizard is the easiest and fastest way to develop database applications without writing a single line of code. We will create a form and work with Order Details table from the sample Northwind database in SQLServer. To start working, select Project->Add New Item->Data Form Wizard from the main menu. The dialogue box for that looks like the image below.
After selecting Data Form Wizard, click Open. The new pane that opens is the DataForm Wizard and it looks like the image below.
Click Next on this pane. Clicking next takes you to a new pane which looks like the image below. Here you need to specify the name for your DataSet.
Here, select the radio button that displays "Create a new dataset named", type a name for the DataSet, and click next. Clicking next opens a pane like the image below.
Here we need to establish a connection to the database. Click on the "New Connection" button to open the "Data Link Properties" window. Set a connection to the database in the Data Link properties window. Here, I am using Northwind database. You can use any database you wish to work with. If you already have a connection you can use it. Once you finish with the Connection, click next. Clicking next takes you to a new pane like the image below.
This pane displays all the tables available in Northwind database. Select the table you want to work and add it using the forward arrow button. I am selecting the Order Details table. Click next once you are finished. The next pane looks like the image below.
This pane allows us to display columns from more than one table by establishing a master-detail relationship. Since we are working with one table, click next on this window. Clicking next takes us to a pane like the image below.
This pane allows us to choose the display style for data. By default all the records are set to be displayed in a data grid. Here, select the radio button which says "Single records in individual controls" which will unlock all the checkboxes. Uncheck the check box where it says "Cancel All" and click finish. Clicking finish adds the Data Entry Form with all the required textboxes and navigation controls (buttons). The image below displays that.
Run the form and click the Load button located at the top of the form to load the data into the form. Using the navigation controls you can move to the next record, last record, previous record and the first record. You can also enter/delete/update data into the table. Type text in the textboxes and click the insert button to insert data into the table or select a record and delete it or make changes to a record and update it by clicking the appropriate buttons. Also open the code behind file to take a look at the code Visual Basic generated for us.
Popular Posts
-
Now I will show you how to retrieve the data posted from a HTML file in a JSP page. Consider an html page that prompts the user to enter his...
-
Accessing the Standard CGI Variables: To build the successful web application, you often need to know a lot about the environment in which ...
-
INTRODUCTION TO 'C': C is a programming language developed at AT & T's Bell laboratories of USA in 1972.it was designed by d...
-
SQL aliases can be used with database tables and with database table columns, depending on task you are performing. SQL column aliases are u...
-
Learning about Events (Continue) Lets program the Form_Load event. "MsgBox" is Visual Basic command that launch a message box. for...
-
Steps to follow: 1. Write Person.java as shown below in Code-11.3.a under polypackage directory. (You are welcome to do this work using eit...
-
The Command Button's KeyPress, KeyDown and KeyUp Events The events that will be mentioned in the following pages are commonly used, and ...
-
The SQL AVG aggregate function selects the average value for certain table column. Have a look at the SQL AVG syntax: SELECT AVG(Column1) FR...
-
package interfaceexercise; // Define an interface with three abstract methods. // Any class that implements this interface has to // impleme...
-
We will use the Customers table to illustrate the SQL LIKE clause usage: FirstName LastName Email DOB Phone John Smith John.Smith@yaho...
No comments:
Post a Comment