mardi 26 mai 2015

Updating Database On CheckBox Check/Uncheck Event

I am trying to follow This tutorial on updating a database on the check/uncheck event of a check box. However, I am getting a compile error on this line of code Int64 nID = Convert.ToInt64(GridView1.DataKeys[((GridViewRow)chkStatus.NamingContainer).RowIndex].Value);

And the compile error is

Error 111 'object' does not contain a definition for 'Value' and no extension method 'Value' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?)

What will remedy this? And is this still the best method to update a database based off the check or unchecked of a check box?




Aucun commentaire:

Enregistrer un commentaire