S
Stefan
Hey Folks,(New to .NET)
This is driving me NUTZ... If anyone out there can resolve this from me
I would greatly appreciate it...
Line 238:
Line 239: // Gets the value of the key field of the row being updated
Line 240: string key = DataGrid1.DataKeys[e.Item.ItemIndex].ToString();
Line 241:
private void DataGrid1_UpdateCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
string queueOwner;
// Gets the value of the key field of the row being updated
string key = DataGrid1.DataKeys[e.Item.ItemIndex].ToString();
// The first column -- Cells(0) -- contains the Update and Cancel buttons.
TextBox tb;
// Gets the value the TextBox control in the third column
tb = (TextBox)(e.Item.Cells[3].Controls[0]);
queueOwner = tb.Text;
dsNewsGroupID.DevComm_NG_ListRow r;
r = dsNewsGroupID.DevComm_NG_List.FindByNewsgroupID(int.Parse(key));
// Updates the dataset table.
r.QueueOwner = queueOwner;
// Calls a SQL statement to update the database from the dataset
sqlDataAdapter1.Update(dataSet1);
// Takes the DataGrid row out of editing mode
DataGrid1.EditItemIndex = -1;
// Refreshes the grid
DataGrid1.DataBind();
}
This is driving me NUTZ... If anyone out there can resolve this from me
I would greatly appreciate it...
Line 238:
Line 239: // Gets the value of the key field of the row being updated
Line 240: string key = DataGrid1.DataKeys[e.Item.ItemIndex].ToString();
Line 241:
private void DataGrid1_UpdateCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
string queueOwner;
// Gets the value of the key field of the row being updated
string key = DataGrid1.DataKeys[e.Item.ItemIndex].ToString();
// The first column -- Cells(0) -- contains the Update and Cancel buttons.
TextBox tb;
// Gets the value the TextBox control in the third column
tb = (TextBox)(e.Item.Cells[3].Controls[0]);
queueOwner = tb.Text;
dsNewsGroupID.DevComm_NG_ListRow r;
r = dsNewsGroupID.DevComm_NG_List.FindByNewsgroupID(int.Parse(key));
// Updates the dataset table.
r.QueueOwner = queueOwner;
// Calls a SQL statement to update the database from the dataset
sqlDataAdapter1.Update(dataSet1);
// Takes the DataGrid row out of editing mode
DataGrid1.EditItemIndex = -1;
// Refreshes the grid
DataGrid1.DataBind();
}