deleting rows in grid view

May 26 2010 8:46 AM
Hi,

I am trying to delete a row in gridview in asp.net using c# language,
but it is deleting entire table.
can any one please tell me the drawback in my code.
I wrote the code like this..

protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        SqlCommand cmd = new SqlCommand("delete emp where eno=eno", con);
        con.Open();
        int i = cmd.ExecuteNonQuery();
        con.Close();
       
    }


Answers (4)