Using Checkbox in ASP.NET GridView Control
This tutorial will show you how to use CheckBox inside GridView and how to handle its events to update database records based on its Checked state.
CheckBox in GridView
Categories Table in SQL Server 2005
Please keep in mind that I put connection string directly in the code just for the demonstration. You should store your database connection string in web.config file. You can also call stored procedure in the above code if you don’t want to write SQL Query directly in your code or you can also call your Data Access Layer component to retrieve Categories Table from database. The following ASP.NET source will show you how you can use TemplateField in the GridView to display CheckBox with the current status of the Category in the database.
To insert Records :
INSERT Categories VALUES('Sms',0);