I am using VS2005 C# and SQL Server 2005.
I have a GridView and this is my current Update statement:
UpdateCommand="UPDATE [UserData] SET [UserID] = @UserIDe, [Username] = @Username, [Age] = @Age, [MemberType]=@MemberType WHERE [UserID] = @UserID
The above statement will update the user row identify by UserID
.
However, I would like the variable UserID
to be editable, thus if I edit my UserID
while updating the table, the row will not be updated because that particular UserID
may not exist.
How can I use the UpdateCommand
and update the row by identifying the row number
of the edited row?