()选择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
()保存该页面并在浏览器中测试它看起来与图类似
()注意如果试图实际删除一场比赛则将会得到一个错误信息这个站点的其他很多方面都依赖于赛程列表所以删除会使得那些数据无法与任何比赛关联
[] [] []