Showing posts with label storing. Show all posts
Showing posts with label storing. Show all posts

Wednesday, March 28, 2012

Question regarding storing session with set context_info

Currently our need is to track the data that is changed by the user and record it as a part of the Audit Log.

We have accomplished this need ny making use ofset context_infoand also by passing the UserId from all the Layers and finally log the user name using the set context_info in the stored proc.

What we thought of was using the trigger for each update,delete records for the table.So by setting the context in teh stored proc we could access the UserId in the trigger and able to record the changes made by Tagged userId.

What we want to make sure before making this as our permananet solution is

(1) Reliability - In a web application (N Tier) how would the context not get out of scope.

2) any Performannce related issues, you guys can think of.

3) This Context used in the database -- would that be the part of the connection used from the UI, meaning the if a request is made from UI to the Database . would the context be alive till the connection doesn't go back to the connection pool.

Thanks

Sweety.

No answers yet.

Any idea wether this approach would be good or not.

Need your Input

Thanks

Friday, March 23, 2012

question on table structure

All,

On my aspx page i have 2 sets of checkboxlists, each with a number of items and i am storing that info in my db. currently i have my table set up this way:

InfoID--PK auto

UserID-int

CheckBoxList1ID-int

CheckBoxList2ID-int

So a user can select more than 1 item in each checkbox, so this table will contain multiple user-ids and each id from the respective checkboxes. My question is, is there a better way to store this data? I hope this is clear, any input would be greatly appreciated.

Thank you.

I would have a table that holds the values for the checkboxes, and another table that bridges the user table and the checkbox value table. This would only have two fields - the user ID and the selected checkbox ID. This is a better way to manage many-to-many relationships. You would have to iterate through the checkboxes and insert a row for each one the user selected.http://www.mikesdotnetting.com/Article.aspx?ArticleID=53

|||

Thanks mike..actually I do have those other 2 tables as well, and I am pretty much doing it like that link you sent, just didn't know if there was a better way. Since thats the way to go, i am happy i don't have to recode..Big Smile . thanks for the response.