Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
My lecturer said we should think about a report log that you use on a windows form.
basically what i am asking is if a user uses my winform that is connected to a database and they add, modify or delete from a database i could just have a button to show the "activity" if any in a text box or a .txt file. like a report log
 
i don't have code yet, if u can help me to get in right direction or an article or code will be helpful
Posted 26-Aug-12 7:14am
Edited 26-Aug-12 7:27am
v2
Comments
gladiatron at 26-Aug-12 14:07pm
   
Try exploring the System.IO namespace its a goldmine of File I/O operations in .NET. Basically, what you want is after every operation i.e. Add, Update, Delete, a line that writes to a file the event, date and time.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

In my opinion, you need to create an 'user-activity' database. It's simple to do, because it should at least have only one table, like this:
ActivityID - INT (IDENTITY)
UserID - INT -> user name, id or any other unique value
DatabaseID -> database name, id or any other unique value
TableId -> table name, id or any other unique value
UserActivity - VARCHAR(255) -> description of user activity
ActivityTime - DateTime

The number of tables or fields depends on your criteria.
 
Before you save data, save user 'activity'.
  Permalink  
Comments
Swinkaran at 26-Aug-12 20:42pm
   
This is fine. May be you create a table in the database(with the fields mentioned by losmac.) and feed each user 'activity' to the database manually. For example, if a new record is added to the table then, Add a new row to the 'activity' table.
 
losmac, 'datetime' of the event should be there
losmac at 27-Aug-12 3:26am
   
I agree with you, it could be a table in the same database, but my practice "tell me": better way to achieve this is to create a separatly database, especially when you are an admin of many databases. ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 693
1 George Jonsson 345
2 BillWoodruff 337
3 PIEBALDconsult 280
4 Sergey Alexandrovich Kryukov 244
0 Sergey Alexandrovich Kryukov 10,744
1 Maciej Los 5,474
2 OriginalGriff 5,352
3 CPallini 3,819
4 BillWoodruff 3,556


Advertise | Privacy | Mobile
Web04 | 2.8.141030.1 | Last Updated 26 Aug 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100