Updating database table datagridview
Please see There are three data tables (Users, Roles and Controls) and two tables that create many-to-many relationships: Users To Roles and Controls To Roles. The Controls table represents a control on a form, and Controls To Roles is the heart of the control-based security approach; it represents the permissions of a given role for a given control on a given form, as is explained in detail below.The application may consist of any number of forms.
There are a number of juicy technical details, and the best way to see them is to walk through them step by step.Jesse Liberty demonstrates a role-based security architecture for Windows Forms applications that will allow you to restrict access to any given control, on any form, so that it is either invisible or disabled, based on who is using the form.One of my clients wanted to be able to restrict any given control, on any form, so that it is either invisible or disabled based on who is using the form.That’s it, otherwise all application forms and their controls (including user controls and custom controls) remain unchanged.Begin by creating a new Windows Forms application in Visual Studio 2005 (or your favorite alternative tool).
The handler for the Save button loops through each indicated control and each indicated role and calls a stored procedure to make a record in Control To Roles (first ensuring there is a record for that control in Controls).