Hello, folks,
I am trying to use a Gridview (ASP.Net 2.0) to update a particular record with the "Edit, Update, Cancel" buttons. For whatever reason, even using other databound controls, such as the DataList, The SqlDataSource wizard will not recognize a parameter in the UPDATE query. So when I use this statement:
UPDATE tbl_Client SET FirstName = @FirstName WHERE ClientID = @ClientID
The @FirstName parameter is obviously the textbox where I edit the first name. The @ClientID parameter is not recognized so the program does nothing. If I remove the WHERE part, we all know what happenes there, I get 5000 clients named "George."
Is there a work around for this? I tried template fields, but when I set them with the "UPDATE" CommandName property, I get the same result. How can I update the data using a hiddenfield with the ClientID passed in or even a Session variable?
Any assistance is appreciated.
Thanks.
I am trying to use a Gridview (ASP.Net 2.0) to update a particular record with the "Edit, Update, Cancel" buttons. For whatever reason, even using other databound controls, such as the DataList, The SqlDataSource wizard will not recognize a parameter in the UPDATE query. So when I use this statement:
UPDATE tbl_Client SET FirstName = @FirstName WHERE ClientID = @ClientID
The @FirstName parameter is obviously the textbox where I edit the first name. The @ClientID parameter is not recognized so the program does nothing. If I remove the WHERE part, we all know what happenes there, I get 5000 clients named "George."
Is there a work around for this? I tried template fields, but when I set them with the "UPDATE" CommandName property, I get the same result. How can I update the data using a hiddenfield with the ClientID passed in or even a Session variable?
Any assistance is appreciated.
Thanks.