I used wizard and created sql data source, and binded a gridview to it, this gridview has an edit link, click edit link, it will show Update and Cancel link. It works fine.
I want to know how to connect to the database (the existing sqldatasource) in the code behind and update a record. When user click Edit link, then input some text into a textbox, and then click Update link, it will automatically update database now, but I also want to manually update the status field for this record to Closed. How to do that in the code behind? I need some code. This is C# application. Thank you in advance.
2. Is there a field in you DB that shows the status of the record?
There is a field named Status in the table.
3. How do you know if the record is closed?
As long as textbox( txtMessage) is not empty and user hits Update button, then we think this record is Closed.