Groups > Databases > MySQL for ASP.NET > Re: Upper Limit to Reader?




Re: Upper Limit to Reader?

Re: Upper Limit to Reader?
Fri, 14 Mar 2008 19:18:20 +000
Get a DataSet instead of  a reader. You can then examine the contents of the
rows in the appropriate table. If getting a DataSet fails, then you know there
is either something wrong with the provider, or in the database data.
Post Reply
Upper Limit to Reader?
Fri, 14 Mar 2008 21:08:56 +000
Hi I have a question that is dogging me right now - actually it has been dogging
me all day.

I have a Reader that I am looping and for some reason when it reaches the 901st
record it dies. It throws the following exception:

 

 Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code. 

 Exception Details: System.FormatException: Input string was not in a correct
format.

Source Error:



Line 127:
Line 128:        ' iterate reader for each performer
Line 129:        Do While oReader.Read()
Line 130:            
Line 131:
 Source File:  C:\VTWP\SITES\ConcertPosterArt\admin\publishperformers.aspx.vb   
Line:  129 

Stack Trace:



[FormatException: Input string was not in a correct format.]
   System.Number.StringToNumber(String str, NumberStyles options,
NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +2755599
   System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
+112
   System.Int32.Parse(String s, IFormatProvider provider) +22
  
MySql.Data.Types.MySqlInt32.MySql.Data.Types.IMySqlValue.ReadValue(MySqlStream
stream, Int64 length, Boolean nullVal) +346
   MySql.Data.MySqlClient.NativeDriver.ReadColumnValue(Int32 index, MySqlField
field, IMySqlValue valObject) +166
   MySql.Data.MySqlClient.MySqlDataReader.Read() +364
   admin_publishperformers.Page_Load(Object sender, EventArgs e) in
C:\VTWP\SITES\ConcertPosterArt\admin\publishperformers.aspx.vb:129
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +47
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint) +1436


 What is interesting is that no matter what that record is it fails on #901. I
can alter the query to order differently so different data exists, but always it
ends in this error.

Is there some sort of upper limit to the number of rows a Reader can handle?

The data is sound - it's an ID field, a Varchar field (with all valid
characters) and two integer fields which are defaulted currently - so they are
either 0 or 1 right now.

 

Because I have run the query that fills the reader in several different ways I
have been able to handle the row it fails on. Meaning the first time I ran it it
failed on the 901st record which was (for the sake of argument)
"Lemon". I thought maybe something odd was up with the record but
there is not. Changing the sort order on the query which fills the reader puts
"Lemon" toward the top and it handles it fine. 

 

I am at a total loss.

 

Some specs:

using VB .NET framework 2.0 MySQL

 

Thanks in advance for any help.
Post Reply
Re: Upper Limit to Reader?
Fri, 14 Mar 2008 21:39:17 +000
The exception appears to be occuring within the MySQL client, which of course is
a third party component.  Are you running the latest version of
MySQLConnector.NET?  Have you posed this question to their support forums?
Post Reply
about | contact