5 Tips & Tricks in ASP.NET
Trick #1 Delete a selected row from a DataGrid using c#
Double click the dataGrid and write the code
private void DataGridvie_selected(Object sender,EventArgs e)
{
DataSet da=new DataSet();
int i=datagrid1.selectedIndex;
int empidval=ds.Tables["emp"].Rows[i][0].ToString();
SqlConnection conn=new Sqlconnection("conn string");
conn.Open();