I have a dataset which contains between 1-70 records. I also dimension 70 string variables which hold the "BundleID" value from each record. If I have 8 records in the dataset, the first 8 string variables will populate successfully, but then I get the following error on #9...
System.IndexOutOfRangeException: There is no row at position 9.
My code (similar for all 70 variables) looks like this...
As you can see I'm trying to use Not IsNull to check if a record exists for the specific dataset row.
How can I check whether or not a dataset row exists without having this exception?
Thanks.
System.IndexOutOfRangeException: There is no row at position 9.
My code (similar for all 70 variables) looks like this...
Code:
If Not IsNothing(dataset.Tables("spMobileBundleIDSelect").Rows.Item(1)("BundleID")) Then StringVariable1 = dataset.Tables("spMobileBundleIDSelect").Rows.Item(1)("BundleID").ToString()
How can I check whether or not a dataset row exists without having this exception?
Thanks.