troubleshooting Question

Error on serialize value system.data.dataset of type system.data.dataset

Avatar of aslyas
aslyas asked on
Programming Languages-OtherWeb BrowsersASP.NET
6 Comments1 Solution2318 ViewsLast Modified:
Hi experts,

I am developing a report in crystal reportx XI R2 for asp.net application, there I make a query to get the records, as the query is processed iseveral times in a cicle to get all records I use a datatable to store the records, at the end the datatable is assigned to a dataset, but when that dataset is assigned to the report, an error occurrs saying:
Error al serializar el valor 'System.Data.DataSet' del valor 'System.Data.DataSet.' as my SO is in spanish error is in spanish, but it is something like the title of my question.

If it is called with few records (10) it works ok, but the problem appear after 1500 records.

Can any body helpme.

Tanks in advance.
dtsDatos = objSQL.GetDataSet(command, objConn)
                If dtsDatos.Tables(0).Rows.Count > 0 Then
                    nomTabla = "aceptacionRiesgosinPRBI_TD"
                    While i <= dtsDatos.Tables(0).Rows.Count - 1
                        row = dtsDatos.Tables(0).Rows(i)
                        MDNombre = row(0)
                        Select Case MDNombre
                            Case "ADELGAZAMIENTO"
                                dtrDatos = objConsulta.ConsultaAceptacionRiesgo(IdAnalisis, "spw_ConsultaAceptacionRiesgoAD", PeriodoInicial, PeriodoFinal, objConn)
                            Case "DAÑO EXTERNO"
                                dtrDatos = objConsulta.ConsultaAceptacionRiesgo(IdAnalisis, "spw_ConsultaAceptacionRiesgoDE", PeriodoInicial, PeriodoFinal, objConn)
                            Case "SCC_GENERAL"
                                dtrDatos = objConsulta.ConsultaAceptacionRiesgo(IdAnalisis, "spw_ConsultaAceptacionRiesgoSCC", PeriodoInicial, PeriodoFinal, objConn)
                            Case "FRACTURA FRAGIL"
                                dtrDatos = objConsulta.ConsultaAceptacionRiesgo(IdAnalisis, "spw_ConsultaAceptacionRiesgoFF", PeriodoInicial, PeriodoFinal, objConn)
                            Case "HTHA"
                                dtrDatos = objConsulta.ConsultaAceptacionRiesgo(IdAnalisis, "spw_ConsultaAceptacionRiesgoHTHA", PeriodoInicial, PeriodoFinal, objConn)
                            Case "LINING"
                                dtrDatos = objConsulta.ConsultaAceptacionRiesgo(IdAnalisis, "spw_ConsultaAceptacionRiesgoLNG", PeriodoInicial, PeriodoFinal, objConn)
                            Case "FATIGA MECANICA"
                                dtrDatos = objConsulta.ConsultaAceptacionRiesgo(IdAnalisis, "spw_ConsultaAceptacionRiesgoFMC", PeriodoInicial, PeriodoFinal, objConn)
                            Case "TUBOS DE HORNOS"
                                dtrDatos = objConsulta.ConsultaAceptacionRiesgo(IdAnalisis, "spw_ConsultaAceptacionRiesgoTBH", PeriodoInicial, PeriodoFinal, objConn)
                        End Select
                        If dtrDatos.HasRows Then
                            While dtrDatos.Read()
                                If tblResultados Is Nothing Then
                                    tblResultados = New Data.DataTable(nomTabla)
                                   tblResultados.Columns.Add("IdInstalacion", Type.GetType("System.Int32"))
                                    tblResultados.Columns.Add("INombre", Type.GetType("System.String"))
                                    tblResultados.Columns.Add("Logo", GetType(Byte())) 'Type.GetType("System.Byte()")
                                    tblResultados.Columns.Add("RTI", Type.GetType("System.Decimal"))
                                    tblResultados.Columns.Add("RTF", Type.GetType("System.Double"))
                                    tblResultados.Columns.Add("IdPlanta", Type.GetType("System.Int32"))
                                    tblResultados.Columns.Add("PNombre", Type.GetType("System.String"))
                                    tblResultados.Columns.Add("IdComponente", Type.GetType("System.Int64"))
                                    tblResultados.Columns.Add("CNombre", Type.GetType("System.String"))
                                    tblResultados.Columns.Add("Etiqueta", Type.GetType("System.String"))
                                    tblResultados.Columns.Add("IdAnalisis", Type.GetType("System.Int64"))
                                    tblResultados.Columns.Add("FechaAnalisis", Type.GetType("System.String"))
                                    tblResultados.Columns.Add("Tiempo", Type.GetType("System.Int16"))
                                    tblResultados.Columns.Add("vPRBI", Type.GetType("System.Int16"))
                                    tblResultados.Columns.Add("RI", Type.GetType("System.Decimal"))
                                    tblResultados.Columns.Add("RF", Type.GetType("System.Double"))
                                    tblResultados.Columns.Add("TDES", Type.GetType("System.Decimal"))
                                    tblResultados.Columns.Add("EPI", Type.GetType("System.String"))
                                    tblResultados.Columns.Add("EPRBI", Type.GetType("System.String"))                                    
                                End If
                              RI = dtrDatos(14)
                                RF = dtrDatos(15)
                              rowRes = tblResultados.NewRow()
                                rowRes(0) = dtrDatos(0) 'IdInstalacion
                                rowRes(1) = dtrDatos(1).ToString.Trim                            
                                If Not BytesLogo Is Nothing Then
                                    rowRes(2) = BytesLogo 'dtrDatos(2)
                                Else
                                    rowRes(2) = 0
                                End If
                                rowRes(3) = dtrDatos(3).ToString.Trim  
                                rowRes(4) = dtrDatos(4)  
                                rowRes(5) = dtrDatos(5) 
                                rowRes(6) = dtrDatos(6).ToString.Trim  
                                rowRes(7) = dtrDatos(7)  
                                rowRes(8) = dtrDatos(8).ToString.Trim  
                                rowRes(9) = dtrDatos(9).ToString.Trim  
                                rowRes(10) = dtrDatos(10)  
                                rowRes(11) = dtrDatos(11).ToString.Trim  
                                rowRes(12) = dtrDatos(12)  
                                rowRes(13) = dtrDatos(13) 
                                rowRes(14) = RI 'dtrDatos(14) 
                                rowRes(15) = RF 'dtrDatos(15)                                 
                                 rowRes(16) = 0
                                 rowRes(17) = dtrDatos(17)
                                rowRes(18) = dtrDatos(18)
                                tblResultados.Rows.Add(rowRes)
                                rowRes = Nothing
                            End While
                        End If
                        i += 1
                        If Not dtrDatos Is Nothing Then dtrDatos.Close()
                    End While
                End If            
            End If           
            consultaAceptacionRiesgo = New Data.DataSet()
            If Not tblResultados Is Nothing Then
                consultaAceptacionRiesgo.Tables.Add(tblResultados)
                If chkvPRBI.Checked = False Then
                    consultaAceptacionRiesgo.Tables(0).DefaultView.RowFilter = "vPRBI = 0"
                End If
            Else
                consultaAceptacionRiesgo.Tables.Add()
            End If
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 6 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros