I am using the UltraWebGrid and want to track who is making a change to the data. I am using stored procedures for my select, insert, update and delete commands in the grid. When someone updates a record, I would like to send the username (current user logged in) to the stored procedure so that it can be updated in the table, but I can't figure out how to send the username as a parameter. Any help is appreciated. Thanks!
Hmmm...even when I change it so that the SQLSataSource uses SQL statements instead of stored procedures, I still can't seem to figure out how to send the UserName.
My code looks like this right now: INSERT INTO tblLookup_Diag_Codes_CHF(Diag_Code) SELECT Diag_Code = @Diag_Code
but I want it to look like this: INSERT INTO tblLookup_Diag_Codes_CHF(Diag_Code, Inserted_By) SELECT Diag_Code = @Diag_Code, Inserted_By = @Inserted_By
except I need the @Inserted_By to be the login of the user that is currently logged in.
I found another page through MSDN that may help:Using Parameterized Queries with the SqlDataSource
In particular, take a look at "Step 5: Assigning Parameter Values Programmatically".