Index out of range error with datasets

  • Thread starter Thread starter Dennis
  • Start date Start date
D

Dennis

I am getting an ArgumentOutofRangeException. Index out of
range. Must be a non-negative value...

when I delete all rows from a datatable in a 5-table
dataset and then insert the same number of rows or more.

The first time I do this, it usually succeeds, but if I
run my function again, I get the exception.

Steps:
1. Click button to run function.
2. Save current status of dataset to database.
3. Accept changes.
4. Delete all rows in tblThree
5. Insert rows back into tblThree
6. Save dataset to database
7. Accept changes
8. Re-run Step 1.

Then I get the exception.

Any ideas?

Thanks,
Dennis
 
Dennis,

Can you post a small sample of code surrounding the problem. Also, check for
the number of records in the datatable immediately before the problem
occurs.

Kathleen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top