Hi,

We are trying to discover the source of a very strange record Add and Delete
problem.

When we Add records to the table the first two records work just fine, but
adding a the third record results ArgumentOutOfRangeException "Index" is
thrown. It is
also thrown when attempting to add a record beyond the third. But, if one
catches the exception and retries the Add it succeeds, most of the time.
Here is the code we use to trap and retry the add

Sub AddArecord(....)

' Create a new row

dr = dsOrder.Tables(TN_ORDER_DETAIL).NewRow()



... Values in the new record are set here

' Add the row

Try

dsOrder.Tables(TN_ORDER_DETAIL).Rows.Add(dr)

Catch ex As System.ArgumentOutOfRangeException

dsOrder.Tables(TN_ORDER_DETAIL).Rows.Add(dr)

End Try

End Sub


Another strange thing is that when we delete records, we throw the
ArgumentOutOfRangeException "Index" if the tables has 3 records and you
delete one. But if the table has 4 records you do not generate the
exception on a delete.

Is there some sort of max record in table property the we set to 2, or ???
I am baffled and appreciate any help.

BTW, we are using VB.net, ,Net Framwork 1.1, MDAC 1.7, and SQL Server 2000.

Thanks,

Jerry