0

I'm trying to get tables from my SQLite db into a dataset but I get an error "A circular reference was detected while serializing an object of type 'System.Globalization.CultureInfo'." From what I read online I need to use the attribute but I have no idea where.

This is the http handler i'm using:

Imports System.Web.Script.Serialization

Public Class HTTPHandler
Implements System.Web.IHttpHandler

Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest

    Dim dataset = _Default.GetTables()

    Dim serializer As New JavaScriptSerializer

    Dim serDS = serializer.Serialize(dataset)

    context.Response.ContentType = "aplication/json"
    context.Response.ContentEncoding = Encoding.UTF8
    context.Response.Write(serDS)
End Sub

ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
    Get
        Return False
    End Get
End Property

End Class
Michael
  • 311
  • 4
  • 22

1 Answers1

0

Sorry for my bad english. I'm learning the language yet.

So, about your question:

Try:

Dim serDS = serializer.Serialize(dataset.GetXml())

Theorically, Dataset is serializabled... but for some reason i dont know... it doens't work if you don't convert to xml.

More one time, sorry for my horrible english =p

Daniel1791
  • 16
  • 2
  • Yes that works but it just gives me a long string that will be really difficult to parse out. Is there any way to use ScriptIgnore to just ignore the circular reference? – Michael Nov 03 '15 at 23:45