是否可以在SQL Server數據庫中的兩個連接表中加載數據並將其轉換爲json格式?它就像你有數據(在表1中)並且該數據的子數組在表2上。ASP.NET + SQL SERVER + JSON =如何獲取SQL Server中兩個連接表中的數據並以JSON方式加載?
{
"id": "0001", ///*** this data is from table1
"name": "Menu1",
"Submenus":
[ ///*** this data is from table2
{ "id": "1001", "text": "Regular" },
{ "id": "1002", "text": "Chocolate" },
{ "id": "1003", "text": "Blueberry" },
{ "id": "1004", "text": "Devil's Food" }
]
}
我只是想創建一個靈活的菜單控件,其數據從數據庫中加載。
請幫我...