Click here to Skip to main content
13,091,145 members (87,137 online)
Rate this:
Please Sign up or sign in to vote.
See more: , +
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
Updated 26-Aug-12 7:27am
Meysam Tolouee 26-Aug-12 13:34pm
You should try something and if you have any problem we are here.
gladiatron 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
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)<br />
UserID - INT  -> user name, id or any other unique value<br />
DatabaseID -> database name, id or any other unique value<br />
TableId -> table name, id or any other unique value<br />
UserActivity - VARCHAR(255)  -> description of user activity<br />
ActivityTime - DateTime<br />

The number of tables or fields depends on your criteria.

Before you save data, save user 'activity'.
Swinkaran 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 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
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.170813.1 | Last Updated 26 Aug 2012
Copyright © CodeProject, 1999-2017
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