Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

UPDATE statement and Edit control in datagrid

When I try to update a record, I get:

Specified argument was out of the range of valid values. Parameter name:
index

Exception Details: System.ArgumentOutOfRangeException: Specified argument
was out of the range of valid values. Parameter name: index

Source Error:

Line 133: SqlCommand updCommand = new SqlCommand();
Line 134: updCommand.Connection = conn;
Line 135: updCommand.CommandText = "UPDATE GEM.customers SET name = '"
Line 136: + ((TextBox)e.Item.Cells[6].Controls[0]).Text
Line 137: + "', address = '"

and the UPDATE line is selected. Can someone tell me what the error means?

Thanks,

Antonio
[725 byte] By [antonio] at [2007-11-11 8:49:37]
# 1 Re: UPDATE statement and Edit control in datagrid
Do you mean line 135 is highlighted?
xnemsis at 2007-11-11 21:46:54 >
# 2 Re: UPDATE statement and Edit control in datagrid
Yes
antonio at 2007-11-11 21:47:54 >