Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
đặc biệt để các toán hạng của họ rằng chúng tôi sẽ giải thích chi tiết ở đây. Ví dụ, một biểu thức @ Ngày '1998-10-01 'đầu tiên phải chuyển đổi cả nodeset ngày và chuỗi '1998-10-01 số (kết quả NaN), và sau đó so sánh chúng (mà sẽ kết quả sai, kể từ khi NaN so với bất cứ điều gì là sai). SQL XML thay vì thực hiện một chuỗi so sánh, với kết quả dự kiến | SQL Server 2000 XML Sample Applications The second template is a little more complicated as it uses the updategram to allow the user to edit the record. We explored using updategrams in Chapter 15. This template is called ch2 0_ex17.xml. ROOT xmlns updg urn schemas-microsoft-com xml-updategram updg header updg param name eid updg param name fname updg param name lname updg header updg sync updg before EditEmployees eid eid updg before updg after EditEmployees eid eid fname fname lname lname updg after updg sync rOoT The template will take the employee id and use this to select the appropriate record because we do not allow the user to re-write the id for the user only the names we write this back in to make sure that it overwrites the correct record. Save this in the same place as the first template. Writing the ASP Page Now we come on to the main ASP page. Since the page we will be creating is an ASP application it must be placed in a virtual root which must be created using the Internet Services Manager tool. You cannot use the virtual root that was created using the IIS Virtual Directory Management for SQL Server utility because that virtual root is only configured for use with SQL Server and cannot handle ASP requests. To create a new virtual root for the ASP application start the Internet Services Manager tool. To create a new virtual directory highlight the Default Web Site go to the Action menu and select New. Provide the virtual directory name and then path to the physical directory in which the following ASP application will be saved ch2 0_ex17.asp . Let s step through the code for the ASP Page and see what it is doing here. We start by declaring our scripting language VBScript and the EmpID variable to hold the EmpID. LANGUAGE VBSCRIPT Dim EmpID Remember that if the user is loading the page for the first time we want to show them the form to collect user data so we need to check if the id has been specified. So we set EmpID to the value of the input box .