()選擇DetailsView控件打開它的Common Tasks面板並選擇Enable Deleting還要到DetailsView的Properties窗口中將DefaultMode屬性的值設置回原來的ReadOnly
()與前面一樣當VWD創建DetailsView控件的DELETE語句時在檢查要刪除的匹配記錄的字段方面顯得過於謹慎原來的DELETE語句如下所示(確保正在查看的是SqlDataSource DetailsView的數據源控件)刪除陰影部分仔細確認DeleteCommand命令以一個雙引號結束
DeleteCommand=DELETE FROM [Fixtures] WHERE [FixtureID] = @Original_FixtureID
AND [FixtureDate] = @Original_FixtureDate
AND [FixtureType]=@Original_FixtureType
AND [GoalsFor]=@Original_GoalsFor
AND [GoalsAgainst]=@Original_GoalsAgainst
AND [Notes]=@Original_Notes
AND [Opponents] = @Original_Opponents
()保存該頁面並在浏覽器中測試它看起來與圖類似
()注意如果試圖實際刪除一場比賽則將會得到一個錯誤信息這個站點的其他很多方面都依賴於賽程列表所以刪除會使得那些數據無法與任何比賽關聯
[] [] []
From:http://tw.wingwit.com/Article/program/net/201311/14862.html