Quantcast
Viewing all articles
Browse latest Browse all 27405

VS 2012 Clearing a dataset.

I have established a dataset and all other objects needed to manipulate my database and as long as I am using the entire table in my dataset everything is OK. However as soon as I attempt to change from one subset of the table to another I am getting various errors. What is the proper way to clear the dataset so that I can use different subsets. For example, if I am trying to get all entries in which one particular field starts with an "A", then I try to change to those entries that start with "B", this is when I am getting an error. I have tried ds.Clear() [where ds refers to my dataset] and I have returned all integer variables to their initial values. I will display the error message if you need it below:

Code:

An unhandled exception of type 'System.IndexOutOfRangeException' occurred in System.Data.dll
Additional information: There is no row at position 0.

This is only one of many errors. Most of the others appear to occur at the point where I fill the DataAdapter with the new subset of data. These are all very lengthy and something I can't readily copy here.

Any ideas are appreciated.

Viewing all articles
Browse latest Browse all 27405

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>