Where is my EOF?

imikeandfashion

New Member
Usually in the classic asp, i get to do this<BR><BR>If not objRs.eof then<BR> 'do something<BR>Else<BR> Response.write "Sorry no record found"<BR>End if<BR><BR>If the record doesn't exist in the DB, I get to display the error msg.<BR><BR>But in ASP.Net using DataReader, <BR><BR>dtrReader = cmdCommand.ExecuteReader()<BR>While dtrReader.Read<BR> 'proceesing here<BR>End while<BR><BR>how do i know whether the record exist in the DB and display the error msg? Thanks in advance.<BR>Never tried it with a DataReader, but check out this post on finding the equivalent of EOF with a DataSet. <BR><BR>http://www.aspmessageboard.com/forum/showMessage.asp?F=36&M=377770&P=1i'm not EXACTLY sure but i think it's something like...<BR><BR>If NOT dtrReader.IsDbNull(0) Then<BR> While dtrReader.Read()<BR> 'blah<BR> End While<BR>Else<BR> ErrorMessage.Text = "Error!!"<BR>End If<BR><BR>again, i'm not exactly sure. sorry i couldn't be of more help,<BR><BR>../n1ck/thanks for the input. I tried it. I doesn't work. DataReader doesn't have IsDbNull has property. Ohh .. boy I have been through all kind of syntax, but can't seem to get the answer. Doesn't .Net support this kind of method?
 
Back
Top