skitzgirl0072002
New Member
I am looking for the equivalent of <BR>is rs.eof<BR><BR>How can I tell if the SQLDataReader found no records.<BR>Know what I mean?<BR><BR><BR>RobSQLDataReader hasn't anything like .EOF<BR>It uses Read() method to determine if SQLDataReader is empty or not.<BR>This method is used instead of the couple of ADO members such as .EOF property and .moveNext() method.<BR>However you can use some trick to determine whether SQLDataReader is empty. It may be like this:<BR><BR>//C# example<BR><BR> string strSQL = "SELECT * FROM Orders";<BR> SQLConnection conn = new SQLConnection(connString);<BR> SQLCommand myCommand = new SQLCommand(strSQL, conn);<BR> myConnection.Open();<BR> SQLDataReader dtReader=null; <BR> myCommand.Execute(out dtReader);<BR> if(dtReader!=null) //It is trick I mentioned <BR> {<BR> //DataReader is not empty<BR> ...............<BR> }<BR> else<BR> {<BR> //DataReader is empty<BR> ...............<BR> }<BR>..............