Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Database connection in web app
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01506103
Message ID:
01506153
Vues:
39
Bob,

>I am looking into purchasing a SQL Server table audit utility for my MM built web application. The audit function records the user that made the changes but since the app is a web app, the user is always the same as the app only uses a SQL authenticated user. The audit program has a stored procedure that can be run that allows a user name to be passed and that user name will be used for the audit trail generation and it will be maintained for the duration of a connection to the database. I have tested it and it works.
>
>My question is for MM.NET web apps, where would be a good place to place this call in the business objects so that I can pass the currently logged in user from the MM security table? Would it be in ABusinessObject and if so, what method (HookPreSave, possibly?). Keep in mind that the call would hold the user name for the duration of a connection so it needs to be called before the save but also before the connection is dropped.
>
>As always, thanks for any help in this matter.

Since the audit trail usually tracks inserts, updates, deletes (and sometimes SELECTs) based on the stateless nature of the web, it's a good practice to create a constructor for each business object that accepts the user id/name. That way you ensure the business object always has the information it need.

Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform