PC Review


Reply
Thread Tools Rate Thread

DataReader.Read() Ends program

 
 
Andy
Guest
Posts: n/a
 
      2nd Aug 2005
Hi all,

I have an odd problem, which I traced back to a line of code.

I have a record set coming back into a DataReader (OdbcDataReader in my
case). I can .Read() once, but when the loop starts again and the
..Read() is executed a second time, the application just ends.

There are NO exceptions, logs or anything, its as if the .Read method
called Application.Exit().

Any ideas?

Thanks
Andy

 
Reply With Quote
 
 
 
 
Sahil Malik [MVP]
Guest
Posts: n/a
 
      3rd Aug 2005
Do you have a try catch around the DataReader.Read?

Try executing the exact same SQL through ADO classic using VBScript, see if
that throws a GPF.

- Sahil Malik [MVP]
ADO.NET 2.0 book -
http://codebetter.com/blogs/sahil.ma.../13/63199.aspx
----------------------------------------------------------------------------



"Andy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi all,
>
> I have an odd problem, which I traced back to a line of code.
>
> I have a record set coming back into a DataReader (OdbcDataReader in my
> case). I can .Read() once, but when the loop starts again and the
> .Read() is executed a second time, the application just ends.
>
> There are NO exceptions, logs or anything, its as if the .Read method
> called Application.Exit().
>
> Any ideas?
>
> Thanks
> Andy
>



 
Reply With Quote
 
Andy
Guest
Posts: n/a
 
      3rd Aug 2005
Sahil,

Yes, I have a try catch. The program simply terminates. No
exceptions, its as if running the line were Application.Exit().

I did find the cause though; a very badly design ODBC driver. You can
have an OR in the WHERE clause, but if you don't do it EXACTLY the way
it wants, it closes the caller.

Andy

 
Reply With Quote
 
Sahil Malik [MVP]
Guest
Posts: n/a
 
      4th Aug 2005
That is quite terrible, I agree.

--

- Sahil Malik [MVP]
ADO.NET 2.0 book -
http://codebetter.com/blogs/sahil.ma.../13/63199.aspx
----------------------------------------------------------------------------

"Andy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Sahil,
>
> Yes, I have a try catch. The program simply terminates. No
> exceptions, its as if running the line were Application.Exit().
>
> I did find the cause though; a very badly design ODBC driver. You can
> have an OR in the WHERE clause, but if you don't do it EXACTLY the way
> it wants, it closes the caller.
>
> Andy
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
About datareader.read() Osamede.Zhang Microsoft ASP .NET 3 12th Jul 2007 05:48 PM
DataReader has Rows, but can't be read? Bmack500 Microsoft ADO .NET 2 27th Jul 2006 07:53 PM
DataReader problem with while(dr.Read()) Assimalyst Microsoft ADO .NET 3 19th Aug 2005 04:36 PM
read datareader stream and read output parameters at the same time =?Utf-8?B?YmVu?= Microsoft ADO .NET 1 4th Jan 2005 01:31 PM
Quickest way to read from a datareader =?iso-8859-1?Q?S=F8ren_Lund_Jensen?= Microsoft ADO .NET 1 11th Mar 2004 11:54 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:52 AM.