The Screen shot is attached for your reference. Then define the conn connection that will create the connection to SQL Server. SqlConnection conn = Main.GetDBConnection() We have defined the following pulic static variables: In this step we will write the code in FrmLogin that we have created in step 5. Now add a few buttons to the form, for example "Add-New", "Update", "Save" and "Exit" buttons on the form as show in the following picture: We must add a function "Execute" in the Main class, as in the following:Ĭreate another form with the name "frmActivity", as in the following: We must add one more public static function to the Main class that will fetch data from the database as in the following: "Data Source=.\\CRMIS Initial Catalog=PSH User ID=sa Password=#Renp321") Public static SqlConnection GetDBConnection() SQL Server user name and password (user id sa password.#ReconcilE123)Īdd the public static class in the Main.cs as in the following:.But you must modify the data source setting according to your own settings. Now we will create the function "GetDBConnection" as a public function so it can be accessed from anywhere in the project. Create the form according to the picture. Start Visual Studio and create a new Desktop project with the name "UserActivityLog".įirst of all we must create the login form that will help us to understand the basic concepts of the topic. ![]() Now insert one record into the login table. ![]() ) WITH ( PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON ) ON Whether the user edits a client's record or does any transaction or any of many other things.Ĭreate the table with the name "User_Activity_Log".ĬREATE TABLE. Especially while working in the client-server environment where we need to keep track of the System IP, System Name, Login Id, Timestamp and the action performed for any of database applications. ![]() The purpose of this article is to explain how to keep track of user activities in the Database Managements System.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |