Updating records in the database with asp net Cybersex cam 2 cam greece
To populate the Grid View, I am calling Bind Data() method from Page_Load event after checking Is Post Back property of the page, so the Grid View will only be populated when there is no postback on the page (when the page loads for the first time).This will make sure that Bind Data() method will not fire when you are going to edit, update or delete the record.
You can notice that I have kept Required Field Validator too inside the Edit Item Template as I want the textbox to be validated for empty data.
When Delete link of the Grid View will be clicked, it will confirm the user whether they really want to Delete the record, if they will click OK, it will fire On Row Deleting event of the Grid View that will call Delete Record method.
In this method again, I am getting the primary key value using Data Keys property of the Grid View and using it to delete the records from the database.
When I run the program, the records display in the textboxes.
Then, I inserted codes in Button1_Click so that when I change the value of the textboxes, the changes will be sved in the database. Not sure what additem is, that might need converting. Also the way you are concatenating strings to create your SQL is open to SQL injection attacks (owasp.org/index.php/SQL_Injection).