How to record logged in user that made a change in a DataGrid?

I am stuck at basically the last step of my project.I basically have a Employee-only webpage that displays a data grid view with information from a table. At this point an employee can tick a checkbox in the datagrid, press the "Update" link that the Data Grid creates and bam... changes saved. What I need to save the username of the logged in person in a column in a table. Basically I click "Update" and Bam, it updates a column in the database with the username.I am using the built in Login/Register tool that VS.NET came with because I figured... heh, it works. I already took some shots in the dark (thanks to reading stuff in different forums) but I still haven't come up with a working solution. My take is to have a SelectedIndexChanged and a GridView.SelectedRow variable but nothing has worked. Heck, I don't even know how to parametize a logged in username so I can pass that value on to the table in the first place. I just wiped out the code I wrote for it and have a blank slate. Any helps/pointers on how to do this would be fantastic. Thanks in advance.This is the current code I have... Dim row As GridViewRow = GridView1.SelectedRow\[code\] Using cn As New SqlConnection(connectionString) Dim cmd As New SqlCommand() cmd = New SqlCommand("UPDATE Turns2 SET Employee = @UserName WHERE SocioNum = ", cn) cmd.Parameters.AddWithValue("@UserName", CStr(User.Identity.Name.ToString)) End Using\[/code\]I guess that code can work, but I need to also parametize the data from a row in the datagrid, the SocioNum one. How can I do this?
 
Back
Top