Asp.net DataReader读取另一个DataReader的数据

Asp.net DataReader读取另一个DataReader的数据,asp.net,exception,datareader,Asp.net,Exception,Datareader,我在使用asp.net应用程序时遇到了麻烦,也很头疼,有一天,它给我发了很多异常(global.asax),关于从dataReader读取的数据不能转换为特定类型。这里奇怪的问题是,生成excepcion的代码自投入生产以来从未更改过 在任何情况下,一个dataReader都可能读取另一个正在处理的dataReader的信息?在应用程序中,dataReader的配置和连接在模块函数中完成,在页面中调用该函数并使用该dataReader读取一些信息。 我没有发现类似的问题 如果你需要传统的信息,就

我在使用asp.net应用程序时遇到了麻烦,也很头疼,有一天,它给我发了很多异常(global.asax),关于从dataReader读取的数据不能转换为特定类型。这里奇怪的问题是,生成excepcion的代码自投入生产以来从未更改过

在任何情况下,一个dataReader都可能读取另一个正在处理的dataReader的信息?在应用程序中,dataReader的配置和连接在模块函数中完成,在页面中调用该函数并使用该dataReader读取一些信息。 我没有发现类似的问题

如果你需要传统的信息,就去问他们

编辑:

我现在发布一些代码来重新创建其中一个场景:

web项目1“应用程序”:

网络项目2“icomexvi”:

那一天,我遇到的一个例外是:

System.Exception: System.InvalidCastException: Conversion from string "1295|1|SIMPLE COLLECTION" to type 'Integer' is not valid. ---> System.FormatException: Input string was not in a correct format.
at Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String Value, NumberFormatInfo NumberFormat)
at Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String Value)
--- End of inner exception stack trace ---
at Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String Value)
at Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(Object Value)
at application.fw_empresa.rango_decimales(Int32& dec_unitario, Int32& dec_cantidad, Int32& dec_total) in D:\Publicaciones\Comex\Produccion\application\application\App_Clases\clases\fw_empresa.dal.vb:line 161
at icomexvi.ic_proceso_embarque_UI.Page_Load(Object sender, EventArgs e) in D:\Publicaciones\Comex\Produccion\application\icomexvi\proceso_embarque\principal.aspx.vb:line 4398
注:

  • configuracion|u decimales表的字段是十进制字段,这让我感到非常奇怪,以至于可以从该表中读取“1295 | 1 | SIMPLE COLLECTION”
  • 在所有用于读取数据的web项目2“icomexvi”和web项目1“应用程序”中,rs_dr函数被大量使用
  • 为了安全起见,此处省略了连接字符串

提前多谢

发布一些代码怎么样?这不是评估发生了什么的最简单的方法吗?顺便说一句,问题似乎出在来自数据库的数据中,因此示例日期可能会有所帮助,如果代码没有更改,可能是数据库更改了?或者你的数据库中有一些垃圾数据。有人知道发生了什么吗?
Public Class ic_proceso_embarque_UI
    Inherits Web.UI.Page
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim DecimalesCantidad As Integer = 0
        Dim DecimalesValor As Integer = 0
        Dim DecimalesTotal As Integer = 0
        application.fw_empresa.rango_decimales(dec_unitario, dec_cantidad, dec_total)
    End Sub
End class
System.Exception: System.InvalidCastException: Conversion from string "1295|1|SIMPLE COLLECTION" to type 'Integer' is not valid. ---> System.FormatException: Input string was not in a correct format.
at Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String Value, NumberFormatInfo NumberFormat)
at Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String Value)
--- End of inner exception stack trace ---
at Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String Value)
at Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(Object Value)
at application.fw_empresa.rango_decimales(Int32& dec_unitario, Int32& dec_cantidad, Int32& dec_total) in D:\Publicaciones\Comex\Produccion\application\application\App_Clases\clases\fw_empresa.dal.vb:line 161
at icomexvi.ic_proceso_embarque_UI.Page_Load(Object sender, EventArgs e) in D:\Publicaciones\Comex\Produccion\application\icomexvi\proceso_embarque\principal.aspx.vb:line 4398