Dreamweavermx Ultradev Exploration (3-2)

Source: Internet
Author: User
Tags define insert dreamweaver
Dreamweaver Dreamweaver MX Ultradev Exploration (3) Adding records to the database

<4> Our play is here, and that's when you really feel the DW MX is powerful, you can do a lot of seemingly difficult things without writing one line of code. Application--->server behaviors---> Insert record, as shown in figure (3-7).



3-7

DW MX comes with a lot of practical server behavior, like data insertion, update, deletion, and so on, here we will briefly introduce the insertion of data, and other behaviors we'll talk about later. Clicking on it shows a dialog box that inserts data, as shown in figure (3-8). This dialog allows you to build your own database with the form elements that you can use on the page. The following fields need to be filled in.

Connection:You can select the specified database connection in the connection (connect) Database Drop-down list box, or click the Define button to define a database connection if you do not specify a connection. Here we select the database testmx we just specified above.

Insert into Table:This will be a drop-down list of all the tables in the database. We're here to select the datasheet "User table" we just created.

After inserting, go to:This allows the user to redirect to another page after the insertion, that is, a page that is displayed to the user after the data has been successfully saved into the database, telling the user that the data has been inserted into the database. Here we define the insertok.asp. Note: Do not forget to create this page, if you can not find the page will be an error!

Get Values from: Set this field to Form1. It should be the only form on the page, but if you have more than one form, it's possible to make use of a drop-down list of the forms.

Form Elements:The text fields should all be listed here. You must set all of these entries one by one, including selecting the form elements, selecting the appropriate data columns and the proper data types below the text box. The user name is inserted into the username column, the password is inserted into the password column, and the mailbox is inserted into the mailbox column. Just now we have defined the name of the text box and the database field name, so DW MX will automatically let them correspond, we should try to make the table single-name and database field names, this is a good habit.

column and submit as:When the text box is submitted in the data type, we usually do not have to choose, DW MX will automatically make a choice.



3-8
<5> After completing these steps, you can click the OK button and the Server behavior is applied to this page. The Server behavior will automatically write all the code to the page and complete the insertion of the database. As shown in figure (3-9). DW MX uses a different color to indicate that a server behavior is used here.



3-9

Finally, test it! As shown in figure (3-10).



3-10

<6> submit, and then open the database we have just designed, as shown in figure (3-11), we have just submitted the content, obediently lying in the inside, ha ... Dreamweaver MX, make our world more beautiful.



3-11

In the next chapter, we'll talk about how to update the data in the database, and DW MX has more exciting features waiting for us to use.


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: info-contact@alibabacloud.com 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.