Hi,
I designed a datagrid that will get data from sqlserver but cannot See it after running my form. My form is running properly it's only the datagrid that is not appearing. I've put visible to true but no change what so ever. I'm using asp.net. thanx
Loading

Parwej Ahamad12 reputationPosted Dec 6, 2006, 6:22 AM EST
Ndayahundwa Claude41 reputationPosted Dec 7, 2006, 2:26 AM EST
I've got now the datagrid but know I have a problem with updating data of column one by one. when I do update one column all the clumn change. Idon't really know where I went wrong.
this is the code I'm using to update:
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();
}
saravana kumar15 reputationPosted Dec 11, 2006, 1:24 PM EST
just give autogenerated column="true" in datagrid
hope it will work
regards
saravanan
Ndayahundwa Claude41 reputationPosted Dec 12, 2006, 1:59 AM EST
Hi saravanan,
Thanx 4 helping but it does not work.