Update Datagrid question

Results 1 to 2 of 2

Thread: Update Datagrid question

  1. #1
    Join Date
    Dec 1969

    Default Update Datagrid question

    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 &#039;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 = ColValue <BR> Next<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Update Datagrid question

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts