Hi,
I wont suggest to use database every time when user clicks on any activity, rather you can make use of session. Place a datatable or dataset in a session. Add 3 columns to datatable like "UserID", "UserName",and "Activity". Write the common fuction which adds a row into this datatable stored in session with user id and activity.
When user clicks on logout, you can save the details from session into a text file or you can also send the complete datatable to stored procedure, there you can store the log into database and make session variable to null.
Check the below links on how to pass datatable to stored procedure.
Passing a datatable to a Stored Procedure in SQL Server 2008[
^]
Passing an array or DataTable into a stored procedure[
^]
http://forums.asp.net/t/1503816.aspx/1[
^]
hope it works.