Dim dt As DataTable = SqlHelper.MyExecuteReader(SqlText)
Dim js As JavaScriptSerializer = New JavaScriptSerializer()
Dim DMenuInfo As New List(Of GetMenuModels)
Dim outinfo As GetMenuModels = New GetMenuModels()
Dim Arys As List(Of String())
Arys = dt.GetValues("nav|lgicon|spread", "", "[no]")
For Each Ary As String() In Arys
'这边可以获取数据
outinfo.title = Ary(0).ToString()
outinfo.icon = Ary(1).ToString()
outinfo.Spread = Ary(2).ToString()
Dim item As New GetMenuModels.Submenu
Dim Customers As List(Of String())
Customers = dt.GetValues("navigation|smicon|Url", "nav='" & Ary(0).ToString() & "'", "[no]")
For Each Customer As String() In Customers
'这边可以获取数据
item.title = Customer(0).ToString()
item.icon = Customer(1).ToString()
item.href = Customer(2).ToString()
Next
outinfo.children.Add(item)
Next
DMenuInfo.Add(outinfo)
' Dim json As String = js.Serialize(DMenuInfo)
For each str As GetMenuModels In DMenuInfo '这边遍历不到数据
Output.Show(str.ToString)
next
' Return json
是不是我哪边写错代码了?