I would agree... Dean and Charles are amazing... I hope to assend to their level someday; I will keep plugging away at it
Travis D. Falls | Consultant RAFT.Net IT | 860.547.4070 | [EMAIL PROTECTED] -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] Behalf Of Ali Husain Sent: Thursday, September 08, 2005 3:46 PM To: [email protected] Subject: RE: [AspNetAnyQuestionIsOk] Data Reader Issue Dean and Charles.... Without trying to be blasphemous here.... You guys are .NET Gods :-) Thanks. ________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Dean Fiala Sent: Thursday, September 08, 2005 12:40 PM To: [email protected] Subject: Re: [AspNetAnyQuestionIsOk] Data Reader Issue You're reading the next record every time you call .Read(). Simplify your logic to this... If myreaderwriter.Read() Then Page2.Fontsize = 12 Page2.Textpos(xpos + (15 * dateforloop), ypos) Page2.Writetext(myreaderwriter(0)) Else Page2.Fontsize = 12 Page2.Textpos(xpos + (15 * dateforloop), ypos) Page2.Writetext("0") End If On 9/8/05, Ali Husain <[EMAIL PROTECTED]> wrote: > > Hi Gurus: > > > > Correct me if I am crazy here, but in a data reader, either you can have > it read or not read. > > > > In the code below, I stepped through it and it acts correctly when not > reader.read. > > When the reader is suppose to read its skips over that but then does not > go in to the reader.read() if block. > > > > BTW: This is part of a function that reads from the database and creates > a PDF on the fly using a component I bought. (that's what the page2.... > Stuff is) > > I am guessing I am probably missing something really silly here. > > > > > > For dateforloop = 0 To DateDiff(DateInterval.Day, > CDate(Request("sd")), CDate(Request("ed"))) - 1 > > > > calldatetocheck = DateAdd(DateInterval.Day, dateforloop, > CDate(Request("sd"))) > > > > > > strConnwriter = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ > > "Data Source=" & > Server.MapPath("../database/DermaCareCalls.mdb;") > > myConnwriter = New OleDb.OleDbConnection(strConnwriter) > > myConnwriter.Open() > > > > mySqlwriter = "SELECT count(*) as numcalls, aAdSource from > calllog" & _ > > " where acalldate = #" & calldatetocheck & "#" & " and > aAdSource = " & "'" & adsource & "'" & _ > > " group by aadSource " > > > > myCommwriter = New OleDb.OleDbCommand(mySqlwriter, > myConnwriter) > > myreaderwriter = > myCommwriter.ExecuteReader(CommandBehavior.SingleResult) > > > > ------------ Goes in to here with no problem when the SQL Statement > returns nothing > > > > If Not myreaderwriter.Read() Then > > Page2.Fontsize = 12 > > Page2.Textpos(xpos + (15 * dateforloop), ypos) > > Page2.Writetext("0") > > End If > > > > ------------ Supposed to go in to here when the SQL Statement returns > something > > The assumption is that if myreaderwriter.read doesn't NOT read that > means it reads. > > > > If myreaderwriter.Read() Then > > Page2.Fontsize = 12 > > Page2.Textpos(xpos + (15 * dateforloop), ypos) > > Page2.Writetext(myreaderwriter(0)) > > > > End If > > > > myConnwriter.Close() > > myreaderwriter.Close() > > Next > > > > Thanks, > > > > > Ali > > > > [Non-text portions of this message have been removed] > > > > > > Yahoo! Groups Links > > > > > > > -- Dean Fiala Very Practical Software, Inc http://www.vpsw.com [Non-text portions of this message have been removed] ________________________________ YAHOO! GROUPS LINKS * Visit your group "AspNetAnyQuestionIsOk <http://groups.yahoo.com/group/AspNetAnyQuestionIsOk> " on the web. * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED] cribe> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service <http://docs.yahoo.com/info/terms/> . ________________________________ [Non-text portions of this message have been removed] Yahoo! Groups Links ************************************************************************* PRIVILEGED AND CONFIDENTIAL: This communication, including attachments, is for the exclusive use of addressee and may contain proprietary, confidential and/or privileged information. If you are not the intended recipient, any use, copying, disclosure, dissemination or distribution is strictly prohibited. If you are not the intended recipient, please notify the sender immediately by return e-mail, delete this communication and destroy all copies. ************************************************************************* ------------------------ Yahoo! Groups Sponsor --------------------~--> Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life. http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/saFolB/TM --------------------------------------------------------------------~-> Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
