Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Database connection in web app
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01506103
Message ID:
01506160
Views:
34
OK, since I want it for each table then I will add this call in the constructor of ABusinessObject. What is the best way to call this stored procedure? It has one parameter with a sysname type. I tried the following but it does not work:
public ABusinessObject()
        {
            // Enter the default database key as specified in the app.config file
            this.DatabaseKey = "Iluna";
            this.RetrieveAutoIncrementPK = true;
            // Specify the default command type for data retrieval
            this.DefaultCommandType = CommandType.StoredProcedure;
            this.SetUserNameForAudit("BobF");
        }

public void SetUserNameForAudit(string userName)
        {
            IDbDataParameter param1 = this.CreateParameter("@userName", 0);
            param1.Direction = ParameterDirection.Input;
            param1.Value = userName;
            IDbCommand retValue = this.ExecSproc("pr_kr_AuditSetUserName", param1);
        }
>
>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,
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform