Friday, October 9, 2009

Ultradev example tutorial: 3.6 deletes a record

The 3rd chapter: Applied database founds dynamic webpage

The 6th: Delete a record


In getting on, we established a link to delete: Del.asp? Id=<%=(Recordset1.Fields.Item("ID").Value)%>, still be pair of this Id make an issue of.


Open Data Bindings face plate, click pushbutton of " + " , choose Command (Stored Procedure) , open the face plate of Command. Command just as its name implies, execute an order namely. Pursue as follows. One column of the Name in face plate is informal you filled in, it is the jussive name that we should carry out just. Connection is the link that we had established. Type is the operation that you should execute. Next pulling, we can see have 4 choices: None, stored Procedure, insert, update, delete of Delete our choice commands this, next Ultradev can be in one column of SQL generate code automatically:


DELETE FROM

W HERE


Still be not complete so, we nod the Tables in choosing Database Items, choose us to want to undertake the data of the operation expresses deleting: Userinfo, click the Delete pushbutton of the Add To SQL of right, meet in one column of SQL fill automatically on:


DELETE FROM Userinfo

WHERE


Next we should add upper limit to decide a condition, choose us to want to undertake the data of the operation expresses deleting: Userinfo, the field of limit requirement wants in the choice, ID field is of course here, click Where pushbutton, one column of SQL turns into:


DELETE FROM Userinfo

WHERE ID =


What is ID equal to, we will impose a sentence by hand. Click pushbutton of " + " , generate a blank travel in the meeting in Variables, a name is filled to go in in Name, we use Del_id here, fill in Run-time Value again next on: Request.querystring("id") . Hey, see here has a friend to wanted to ask, what meaning is this? A that when found record volume in wanting you to get on to compile data again only actually in, after installing Filter, click that Advanced pushbutton, the Sql statement that you can see Ultradev is generated for us, have among them so a Request.querystring("id") , this is equivalent to the URL Parameter in our Filter. After filling in, click OK, our delete a page to be generated.



Because this Command face plate was not us to offer to jump,turn the option of the page, we should add a statement to just go additionally. Choose menu Insert ->Head Tags ->Refresh



Face plate setting is be clear at a glance, need not I said more:)

Add jump turn we let open browser window after the page, choose the Dd+dd record that we just alter, click delete join, look, our record had been deleted!



Below on e content is to make a simple inquiry, please advertent.

No comments:

Post a Comment