使用如下视图创建数据源:主键是主键。对此类用户的插入、更新、选择、删除视图的权限:
" DeleteCommand="删除 [VW_Security_UK_UserAccess] WHERE [MainKey] = @MainKey"
InsertCommand="INSERT INTO [VW_Security_UK_UserAccess] ([UserName], [HasAccess], [ApplicationDefinitionmainkey], [SortOrder]) VALUES (@UserName, @HasAccess, @ApplicationDefinitionmainkey, @SortOrder)"
SelectCommand="SELECT [MainKey], [UserName], [HasAccess], [ApplicationDefinitionmainkey], [SortOrder] FROM [VW_Security_UK_UserAccess]"
UpdateCommand="UPDATE [VW_Security_UK_UserAccess] SET [UserName] = @UserName, [HasAccess] = @HasAccess, [ApplicationDefinitionmainkey] = @ApplicationDefinitionmainkey, [SortOrder] = @SortOrder WHERE [MainKey] = @MainKey">
<DeleteParameters>
<asp:Parameter Name="MainKey" Type="Int16" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="UserName" Type="String" />
<asp:Parameter Name="HasAccess" Type="String" />
<asp:Parameter Name="ApplicationDefinitionmainkey" Type="Byte" />
<asp:Parameter Name="SortOrder" Type="Int32" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="UserName" Type="String" />
<asp:Parameter Name="HasAccess" Type="String" />
<asp:Parameter Name="ApplicationDefinitionmainkey" Type="Byte" />
<asp:Parameter Name="SortOrder" Type="Int32" />
<asp:Parameter Name="MainKey" Type="Int16" />
</UpdateParameters>
</asp:SqlDataSource>