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
Ndayahundwa ClaudePosted Dec 12, 2006, 6:59 AM
Hi saravanan,
Thanx 4 helping but it does not work.
saravana kumarPosted Dec 11, 2006, 6:24 PM
just give autogenerated column="true" in datagrid
hope it will work
regards
saravanan
Ndayahundwa ClaudePosted Dec 7, 2006, 7:26 AM
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();
}
Parwej AhamadPosted Dec 6, 2006, 11:22 AM