01.
<asp:SqlDataSource
02.
ID=
"SqlDataSource1"
03.
runat=
"server"
04.
ConnectionString=
"<%$ ConnectionStrings:NorthwindConnectionString %>"
05.
DeleteCommand=
"DELETE FROM Suppliers WHERE (SupplierID = @SupplierID)"
06.
InsertCommand="INSERT INTO Suppliers
07.
(CompanyName,
08.
ContactName,
09.
ContactTitle,
10.
Address,
11.
City,
12.
Region,
13.
PostalCode,
14.
Country,
15.
Phone,
16.
Fax)
17.
VALUES
18.
(@CompanyName,
19.
@ContactName,
20.
@ContactTitle,
21.
@Address,
22.
@City,
23.
@Region,
24.
@PostalCode,
25.
@Country,
26.
@Phone,
27.
@Fax);
28.
SELECT @newId = @@Identity;"
29.
30.
SelectCommand="SELECT
31.
SupplierID,
32.
CompanyName,
33.
ContactName,
34.
ContactTitle,
35.
Address,
36.
City,
37.
Region,
38.
PostalCode,
39.
Country,
40.
Phone,
41.
Fax
42.
FROM Suppliers"
43.
44.
UpdateCommand="UPDATE Suppliers SET
45.
CompanyName = @CompanyName,
46.
ContactName = @ContactName,
47.
ContactTitle = @ContactTitle,
48.
Address = @Address,
49.
City = @City,
50.
Region = @Region,
51.
PostalCode = @PostalCode,
52.
Country = @Country,
53.
Phone = @Phone,
54.
Fax = @Fax
55.
WHERE (SupplierID = @SupplierID)"
56.
57.
OnInserted=
"SqlDataSource1_Inserted"
>
58.
59.
<DeleteParameters>
60.
<asp:Parameter Name=
"SupplierID"
Type=
"Int32"
/>
61.
</DeleteParameters>
62.
63.
<UpdateParameters>
64.
<asp:Parameter Name=
"CompanyName"
Type=
"String"
/>
65.
<asp:Parameter Name=
"ContactName"
Type=
"String"
/>
66.
<asp:Parameter Name=
"ContactTitle"
Type=
"String"
/>
67.
<asp:Parameter Name=
"Address"
Type=
"String"
/>
68.
<asp:Parameter Name=
"City"
Type=
"String"
/>
69.
<asp:Parameter Name=
"Region"
Type=
"String"
/>
70.
<asp:Parameter Name=
"PostalCode"
Type=
"String"
/>
71.
<asp:Parameter Name=
"Country"
Type=
"String"
/>
72.
<asp:Parameter Name=
"Phone"
Type=
"String"
/>
73.
<asp:Parameter Name=
"Fax"
Type=
"String"
/>
74.
<asp:Parameter Name=
"SupplierID"
Type=
"Int32"
/>
75.
</UpdateParameters>
76.
77.
<InsertParameters>
78.
<asp:Parameter Name=
"CompanyName"
Type=
"String"
/>
79.
<asp:Parameter Name=
"ContactName"
Type=
"String"
/>
80.
<asp:Parameter Name=
"ContactTitle"
Type=
"String"
/>
81.
<asp:Parameter Name=
"Address"
Type=
"String"
/>
82.
<asp:Parameter Name=
"City"
Type=
"String"
/>
83.
<asp:Parameter Name=
"Region"
Type=
"String"
/>
84.
<asp:Parameter Name=
"PostalCode"
Type=
"String"
/>
85.
<asp:Parameter Name=
"Country"
Type=
"String"
/>
86.
<asp:Parameter Name=
"Phone"
Type=
"String"
/>
87.
<asp:Parameter Name=
"Fax"
Type=
"String"
/>
88.
<asp:Parameter Direction=
"Output"
Name=
"newId"
Type=
"Int32"
/>
89.
</InsertParameters>
90.
</asp:SqlDataSource>