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

Re: DataReader.Read() Ends program by Sahil

Sahil
Tue Aug 02 22:01:00 CDT 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.malik/archive/2005/05/13/63199.aspx
----------------------------------------------------------------------------



"Andy" <ajohnstone@capcitypress.com> wrote in message
news:1123010904.117146.170730@g44g2000cwa.googlegroups.com...
> 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
>



Re: DataReader.Read() Ends program by Andy

Andy
Wed Aug 03 07:12:17 CDT 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


Re: DataReader.Read() Ends program by Sahil

Sahil
Wed Aug 03 22:19:55 CDT 2005

That is quite terrible, I agree.

--

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

"Andy" <ajohnstone@capcitypress.com> wrote in message
news:1123071137.559928.169260@g44g2000cwa.googlegroups.com...
> 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
>