Foros del Web » Programación para mayores de 30 ;) » .NET »

Attempted to read or write protected memory. This is often an indication that other m

Estas en el tema de Attempted to read or write protected memory. This is often an indication that other m en el foro de .NET en Foros del Web. Estoy intentando leer los datos devueltos por una consulta, pero obtengo este error en el read del FbDataReader. Este es el código que utilizo. Friend ...
  #1 (permalink)  
Antiguo 15/10/2006, 14:54
 
Fecha de Ingreso: febrero-2002
Mensajes: 58
Antigüedad: 22 años, 2 meses
Puntos: 0
Attempted to read or write protected memory. This is often an indication that other m

Estoy intentando leer los datos devueltos por una consulta, pero obtengo este error en el read del FbDataReader. Este es el código que utilizo.


Friend FbConnection As FirebirdSql.Data.FirebirdClient.FbConnection

Friend SQL As String
Friend dbDataAdapter As FirebirdSql.Data.FirebirdClient.FbDataAdapter
Friend dbDataSet As New Data.DataSet
Friend dr As FbDataReader
..................

FbConnection = New FirebirdSql.Data.FirebirdClient.FbConnection(Caden aConexion)
dbDataSet.Clear()

If (FbConnection.State = ConnectionState.Closed) Then
FbConnection.Open()
End If

........

SQL = "select CATE_ID from T_CATEGORIAS WHERE CATE_NOMBRE='@v_categoria'"

Dim prm As New FbParameter
Dim cmd As FbCommand



cmd = New FbCommand(SQL, FbConnection, Transaccion)
cmd.Parameters.Add("@v_categoria", FbDbType.VarChar).Value = "Cat1"
cmd.CommandType = CommandType.Text

dr = cmd.ExecuteReader()
While dr.Read --------- Fail in this line
dr.Item("CATE_ID").ToString()
End While


dr.Close()


Gracias
__________________
Un saludo
Mafc
España

Última edición por mafc; 20/10/2006 a las 18:13
  #2 (permalink)  
Antiguo 26/10/2006, 04:46
 
Fecha de Ingreso: febrero-2002
Mensajes: 58
Antigüedad: 22 años, 2 meses
Puntos: 0
Nadie puede darme una solución o alguna idea de por donde investigar?.

Gracias
__________________
Un saludo
Mafc
España
  #3 (permalink)  
Antiguo 05/11/2006, 10:24
 
Fecha de Ingreso: febrero-2002
Mensajes: 58
Antigüedad: 22 años, 2 meses
Puntos: 0
Attempted to read or write protected memory ....

Sigo cerrando el cerco, el problema ocurre solo cuando en la clausula where pregunto por un campo varchar. Si pregunto por otro tipo de dato funciona bien.

SQL = "select CATE_ID from T_CATEGORIAS WHERE CATE_NOMBRE='@v_categoria'"

Dim prm As New FbParameter
Dim cmd As FbCommand


cmd = New FbCommand(SQL, FbConnection, Transaccion)
cmd.Parameters.Add("@v_categoria", FbDbType.VarChar).Value = "Cat1"
cmd.CommandType = CommandType.Text
__________________
Un saludo
Mafc
España
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 17:39.