Ultradev Example Tutorial: 3.4 Adding a record to a database

Source: Internet
Author: User
Tags commit insert
Tutorials | data | database Chapter III: Application database to create dynamic Web pages

section Fourth: Adding records to the database

Before the database was not recorded in order to test the convenience we directly manipulate the database, add a few data to it. The following is a page that teaches you to submit data so that we can add data to the database through the browser. This is the more popular browser-server mode. *_"

OK, let's get started!

The first step: open Ultradev---oh, nonsense.

Open the menu Insert-> liveobjects-> record insertion Form, as shown in the following illustration:



When selected, the following dialog box appears for inserting data form properties.



Connection is a database connection that we have already defined in our site, and when selected, the table in the database you are connecting to will appear in the INSERT into table column, and then select the table from which you want to insert the data. Our database has only one userinfo table, select him. Then, in the form fields below, we have the fields and their associated properties that we designed in the table design, column represents the field name in the database table, and Display as represents what type of form field, such as the text table fields, to submit our records. Submit as represents what data type to commit, such as a field with an integer data type we cannot commit with a literal data type. In general this column Ultradev will help us choose automatically. The label will help prompt you to fill in the form field. After inserting, went to a column is when you submit the data to jump to the page, such as the general registration success will jump to a page, tell you that you have registered success, welcome to use what what, is such a son. If you do not fill in the words will be submitted after the completion of the data returned to this page.

Next, select the fields that we want to add to the data. Here, the ID is automatically numbered and generated automatically by the database, so don't let us work on him, select this line, click on the button that has "-" and delete him. Reg_date Field we gave him a default value in the database design =now (), there will be a database automatically generated, and do not need our intervention, so also deleted. Then we will change the label to Chinese, such a Add data form is done, see the following figure:


After clicking OK, generate the page shown in the following figure. Wow! Are you familiar with the eyes? Haha, a simple user registration page is complete, so easy! If you are interested, you can look at the code generated by Ultradev for us, long!



Oh, don't forget one more place to set up, is the user password section of the form field properties, to set his type to password, the following figure. In this way, the input password will not be shown in plaintext, but instead of using *.



Save the page, then let's try our results, open the browser, enter the address, and then casually fill in some data, see the following figure:



Click the Insert record to submit the data, and then jump to the page showing the data, haha, see, we just lost in the data obediently lying there. I believe you have once again experienced the powerful ultradev, just a few mouse, a full-featured page out, if the use of handwritten words still do not know when to write, still have to keep testing.



In fact, this registration function is still imperfect, such as the use of duplicate data input how to do? Some content to fill the user is not filled and what to do? These questions are left to the later Ultradev Advanced use Guide to speak again, friends just wait a little patience.

OK, next time we'll talk about how to edit the records inside the database. Yes, in case I accidentally lose the wrong data, do not change how to do. As for how to do this, and listen to let's.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: [email protected] and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.