RS.EOF?????

BillWede

New Member
What is the equivalent to RS.EOF in VB.NET???but there is no such thing, even in classic ASP, as a RS.EOF<BR><BR>Perhaps what you mean is that *RS* is a variable that once was declared like this:<BR><%<BR>Dim RS<BR>%><BR><BR>Then you probably created a Recordset object transforming your *RS* variable into an object using this:<BR><BR><%<BR>Dim RS<BR>Set RS = Server.CreateObject("ADODB.Recordset")<BR>%><BR><BR>Then that *RS* variable, which is in fact an object can now have properties and methods. So *EOF* is one of them<BR><BR>As for .NET then you must have something like :<BR><BR>Dim RS As New DataSet()<BR><BR>The notion of "Recordsets" don't exist in .NET (not 100% sure of that, you'll have to check it out since I'm only in chapter 2 of my new book :)) it has now been replace by DataSet which is a kind of "disconnected Recordset"<BR><BR>Checkout the docs on DataSet<BR><BR>Hope this helps...oh and if I'm wrong well please advise me so I can return my book.<BR><BR>Sincerely<BR>VlinceSo...Because a DataSet doesn't have an EOF property, we have to get a count of the records, and if there aren't any, treat that as you would an EOF. <BR><BR>Like so....<BR><BR>'You've created, and filled DataSet DS<BR><BR>MyTable = DS.Tables(0)<BR>Dim RSCount As Integer<BR>RSCount = MyTable.Rows.Count<BR>If RSCount = 0 Then<BR>'Do whatever you would have done with the classic EOF<BR>End IfIn this example does each row have properties? Can you loop through the rows as you would a recordset in the olden days?<BR><BR>Something like:<BR><BR>For i = to RSCount<BR> Address(i) = MyTable.Rows(i).Columns("Address")<BR>Next<BR><BR><BR><BR><BR>
 
Back
Top