JohnMcCain2008
New Member
trying to update a datagrid and keeping getting the following error "Specified argument was out of the range of valid values. Parameter name: index"..Here is where the code stops in the for loop...Any help is greatly appreciated..Should also be noted that I am using an access database<BR><BR> Dim I As Integer <BR> For I=2 To NumCols-2 'skip first, second and last column <BR> Dim CurrentTextBox As TextBox<BR> CurrentTextBox = E.Item.Cells(I).Controls(0)<BR> Dim ColValue As String = CurrentTextBox.Text<BR> MyCommand.Parameters(Cols(I)).Value = http://aspmessageboard.com/archive/index.php/ColValue <BR> Next<BR><BR>I was trying to update a datagrid the same way and kept getting the same type of error. I finally resorted to updating the DataSet I was binding to the datagrid and just re-binding to the datagrid. It seems to work smoothly.<BR><BR>If you find an answer to the "out of range" issue, please post it.<BR><BR>Good Luck,<BR><BR>Tom T