EOF in Dataset
-
In ASP where recordsets has AbsolutePosition and EOF/BOF. So How I know its the last record in a DataSet. I can´t find EOF and BOF properties of dataset. This is my asp code which I wnat to convert to asp .net if not rsThmModel.EOF then here rsThmodel is a record set
Rock Star
modified on Wednesday, July 9, 2008 7:02 AM
-
In ASP where recordsets has AbsolutePosition and EOF/BOF. So How I know its the last record in a DataSet. I can´t find EOF and BOF properties of dataset. This is my asp code which I wnat to convert to asp .net if not rsThmModel.EOF then here rsThmodel is a record set
Rock Star
modified on Wednesday, July 9, 2008 7:02 AM
-
for (int i=0; i<=DataSet1.Tables[0].Rows.Count-1; i++) // This will read till the EOF correctly. { // Write your logic here. } Hope this helps.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
-
I prforming some operation on the end of the record in the dataset.I dont want to use a loop. Is there any property in the dataset like EOF?
Rock Star
There is no property called EOF in dataset. Either you have to check it in the loop or you have to check with a property called HasRows. Again this will go for a minor loop, like If (DataSet1.Tables[0].Rows.Count > 0) { //Write your logic here. }
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
-
There is no property called EOF in dataset. Either you have to check it in the loop or you have to check with a property called HasRows. Again this will go for a minor loop, like If (DataSet1.Tables[0].Rows.Count > 0) { //Write your logic here. }
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
I think i will give me the number of records in a dataset. What I want to do is do some operation wen I am at the last record. For i = 0 To demodataset.Tables(0).Rows.Count - 1 For j = 1 To 3 ---- Here I want a if condition that if there is no data in a dataset then no need to do the following action --------- id = demodataset.Tables(0).rows("id")
Rock Star
-
I think i will give me the number of records in a dataset. What I want to do is do some operation wen I am at the last record. For i = 0 To demodataset.Tables(0).Rows.Count - 1 For j = 1 To 3 ---- Here I want a if condition that if there is no data in a dataset then no need to do the following action --------- id = demodataset.Tables(0).rows("id")
Rock Star
If you want to get Last record from the dataset then you can go this way
int LastIndex=demodataset.Tables(0).Rows.Count - 1
Now you can get last record from the dataset using this lastindex
id = demodataset.Tables(0).rows(LastIndex)("id")
regard kHan
please don't forget to vote on the post that helped you.