I am using C# Visual Studio 2005 and SQL Server 2005.
I have a GridView table which shows a list of data from my SQL Server database.
I establish my connection via PageLoad method. E.g.:
protected void Page_Load(object sender, EventArgs e)
{
SqlDataSource1.SelectCommand = "SELECT * FROM [UserTable]";
SqlDataSource1.DataBind();
}
<asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1">
</asp:GridView>
However, I am trying to add a function for my Gridview table:
To enable removal of records from the GridView via checkbox of each row of record and a remove button.
The output I want is a checkbox for each row of data of the Gridview, and a ‘Remove’ button which delete all the records with their checkbox ‘checked’.
May I know how can I approach to the outcome that I want?
Thank you
on lnkDelete_Click event
now you have id of table which is primary key and you put your delete code here.