Big problem to update!!

Dec 8 2006 6:39 AM

hi,
what would be the problem with this code because when I want to update it updates all the rest of the columns.


private void Update_dataGrid(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)

{

System.Web.UI.WebControls.TextBox cstaff=new System.Web.UI.WebControls.TextBox();

cstaff=(System.Web.UI.WebControls.TextBox)e.Item.Cells[1].Controls[0];

SqlCommand myCommand=new SqlCommand("update isp_email.staff set stafflevel=@stafflevel where id=id",con);

 

myCommand.Parameters.Add(new SqlParameter("@stafflevel",SqlDbType.VarChar,45));

myCommand.Parameters["@stafflevel"].Value=cstaff.Text;

con.Open();

myCommand.ExecuteNonQuery();

con.Close();

dgupdate.EditItemIndex=-1;

BindData();

}


Answers (1)