当我尝试序列化我的自定义数据集时出现此错误。我在做什么错,它应该很简单吗?
谢谢
错误序列化“System.Globalization.CultureInfo”类型的对象时检测到循环引用。
Dim serializer As New JavaScriptSerializer()
Dim arrayJson As String = serializer.Serialize(makeMYDataSET())
Private Function makeMYDataSET() As DataSet
' Two DataTables.
Dim table1 As DataTable = New DataTable("patients")
table1.Columns.Add("name")
'table1.Columns.Add("id")
table1.Rows.Add("sam")
table1.Rows.Add("mark")
table1.Rows.Add("hjhkhkh")
Dim table2 As DataTable = New DataTable("medications")
'table2.Columns.Add("id")
table2.Columns.Add("medication")
table2.Rows.Add("atenolol")
table2.Rows.Add("amoxicillin")
' Create a DataSet. Put both tables in it.
Dim set1 As DataSet = New DataSet("office")
set1.Tables.Add(table1)
set1.Tables.Add(table2)
Return set1
End Function