columnas System.dbnull

04/01/2006 - 16:27 por Buho | Informe spam
El ejemplo de mi problema es el siguiente:
<<<query analizer>>>
sp1 param1,param2
col1 col2 col3 col4
1 1 2 3
1 2 2 4
2 3 0 9


<<<vb.NET>>>
dbl.addparam(param1)
dbl.addparam(param2)
ds = dbl.runproc("SP1")
ds.tables(0).rows(0)(3) ' or ds.tables(0).rows(0)("col4")
SYSTEM.DBNULL???
'en vez de mostrar el dato o los datos, las columnas obtienen
System.dbnull

'gracias de antemano por cualquier post

Preguntas similare

Leer las respuestas

#1 Jesús López
04/01/2006 - 19:36 | Informe spam
¿Qué es dbl?
Respuesta Responder a este mensaje
#2 Buho
05/01/2006 - 16:20 | Informe spam
Es un objeto q maneja la interaccion con la base de datos DB Layer
Respuesta Responder a este mensaje
#3 Jesús López
06/01/2006 - 10:24 | Informe spam
Pues seguramente el error estará en ese objeto, pero sin ver el código es
imposible saber porqué.

"Buho" escribió en el mensaje
news:
Es un objeto q maneja la interaccion con la base de datos DB Layer

Respuesta Responder a este mensaje
#4 Buho
06/01/2006 - 23:24 | Informe spam
Bueno aqui esta ;la funcion que corre los storeds, hice una prueba
interesante corriendo el stored como una sentencia SQL y llenando el
Dataset y algo raro el comportamiento anterior no se repite osea
ibtengo la tabla con todos los registros...bueno este procedimiento
nunca me ha dado problemas...

Gracias..

Public Overloads Function RunProc(ByVal sProcName As String, ByVal
sTableName As String) As DataSet

Dim oCmd As SqlCommand = New SqlCommand '//
Create a new SqlCommand
Dim oCn As SqlConnection = Nothing '//
Declare the SqlConnection
Dim oDA As SqlDataAdapter = New SqlDataAdapter '//
Create a new SqlDataAdapter
Dim oDs As DataSet = New DataSet '//
Create a new DataSet
Dim oSqlParameter As SqlParameter = Nothing '//
Declare a SqlParameter
Dim oP As Parameter = Nothing '//
Declare a Parameter
'// Get an enumerator for the parameter array list
Dim oEnumerator As IEnumerator m_oParmList.GetEnumerator()
'// Prepare connection to the database
Try
oCn = Connect()
With oCmd
'// Set the CommandText, ActiveConnection
and the Command Type for the
'// SqlCommand Object
.Connection = oCn
.CommandText = sProcName
.CommandType = CommandType.StoredProcedure
End With

'// Loop through the Parameters in the ArrayList
Do While (oEnumerator.MoveNext())
oP = Nothing
'// Get the current Parameter object
oP = oEnumerator.Current
'// Instantiate a SqlParameter object
oSqlParameter = ConvertParameterToSqlParameter(oP)

'// Add the SqlParameter object to the
SqlCommand object
oCmd.Parameters.Add(oSqlParameter)
Loop
With oDA
'// Assign the SqlCommand Object to the
'// Select command of the SqlDataAdapter and
.SelectCommand = oCmd
'// Execute the Stored Procedure and fill the
dataset
End With
oDA.Fill(oDs, sTableName)
Catch ex As Exception
m_oParmList.Clear()
Throw ex
End Try

m_oParmList.Clear()
'// Return the DataSet
Return oDs
End Function
email Siga el debate Respuesta Responder a este mensaje
Ads by Google
Help Hacer una preguntaRespuesta Tengo una respuesta
Search Busqueda sugerida