G
Gustavo Arriola
Attempt to generate a report with CR.
I have a DataSet that I have created manually, is to say with the designer of Visual Studio.NET 2003 (I add the fields to him that I have created with a virtual table in a stored precedimiento the SQL Server). In addition, I have a function that gives back a loaded DataSet to me. The subject is that my function receives the registries perfectly, but at the time of receiving them in my application jumps the following error to me:
The specified conversion is not valid
The code of my function is the following:
Public Function Recepcion_DocumentosPrePago(ByVal id_empresa As Integer, ByVal Fecha_Inicio As String, ByVal Fecha_Fin As String, ByVal ConexionDB As String) As DataSet
Try
SQLda = New SqlDataAdapter("sprecepcion_documentosprepago", ConexionDB)
With SQLda.SelectCommand
..CommandType = CommandType.StoredProcedure
..CommandText = "sprecepcion_documentosprepago"
..Parameters.Add("@id_empresa", SqlDbType.Int).Value = id_empresa
..Parameters.Add("@fecha_inicio", SqlDbType.VarChar, 11).Value = Fecha_Inicio
..Parameters.Add("@fecha_fin", SqlDbType.VarChar, 11).Value = Fecha_Fin
End With
ds.Clear()
SQLda.Fill(ds)
Return ds
Catch ex As Exception
Err = ex.ToString
Finally
'ds.Dispose()
SQLda.Dispose()
End Try
End Function
Soon from my application I make the following thing:
Dim ds As New ds_recepciondocumentos
Where ds_recepciondocumentos the Dataset that I have created with the designer of Studio Line of vision. (right Click on the name of the project, to add new element, DataSet, soon I add the fields and the data types to him that receives)
Soon, in the Load event:
ds = Recepcion.Recepcion_DocumentosPrePago(id_empresa, Fecha_Inicio, Fecha_Fin, ConexionDB) '<<--Error
What I am making bad?
From already thank you very much!
Gustavo!
I have a DataSet that I have created manually, is to say with the designer of Visual Studio.NET 2003 (I add the fields to him that I have created with a virtual table in a stored precedimiento the SQL Server). In addition, I have a function that gives back a loaded DataSet to me. The subject is that my function receives the registries perfectly, but at the time of receiving them in my application jumps the following error to me:
The specified conversion is not valid
The code of my function is the following:
Public Function Recepcion_DocumentosPrePago(ByVal id_empresa As Integer, ByVal Fecha_Inicio As String, ByVal Fecha_Fin As String, ByVal ConexionDB As String) As DataSet
Try
SQLda = New SqlDataAdapter("sprecepcion_documentosprepago", ConexionDB)
With SQLda.SelectCommand
..CommandType = CommandType.StoredProcedure
..CommandText = "sprecepcion_documentosprepago"
..Parameters.Add("@id_empresa", SqlDbType.Int).Value = id_empresa
..Parameters.Add("@fecha_inicio", SqlDbType.VarChar, 11).Value = Fecha_Inicio
..Parameters.Add("@fecha_fin", SqlDbType.VarChar, 11).Value = Fecha_Fin
End With
ds.Clear()
SQLda.Fill(ds)
Return ds
Catch ex As Exception
Err = ex.ToString
Finally
'ds.Dispose()
SQLda.Dispose()
End Try
End Function
Soon from my application I make the following thing:
Dim ds As New ds_recepciondocumentos
Where ds_recepciondocumentos the Dataset that I have created with the designer of Studio Line of vision. (right Click on the name of the project, to add new element, DataSet, soon I add the fields and the data types to him that receives)
Soon, in the Load event:
ds = Recepcion.Recepcion_DocumentosPrePago(id_empresa, Fecha_Inicio, Fecha_Fin, ConexionDB) '<<--Error
What I am making bad?
From already thank you very much!
Gustavo!