我试图将SQLite数据库中的表格转换为数据集,但是我收到错误"在序列化类型为' System.Globalization.CultureInfo&#39的对象时检测到循环引用;"从我在网上看到的,我需要使用属性,但我不知道在哪里。
这是我使用的http处理程序:
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
答案 0 :(得分:0)
抱歉我的英语不好。我还在学习这门语言。
所以,关于你的问题:
尝试:
Dim serDS = serializer.Serialize(dataset.GetXml())
理论上,数据集是可序列化的...但由于某种原因我不知道......如果你不转换为xml,它会起作用。
还有一次,对不起我可怕的英语= p