0
我一個數據綁定與RadioButtonList的LINQ查詢,像這樣:數據綁定使用LINQ
var query = from m in Db.Udt_Menu
orderby m.Name
select m;
this.radMenuSelection.DataValueField = "menuID";
this.radMenuSelection.DataTextField = "name";
this.radMenuSelection.DataSource = query;
this.radMenuSelection.DataBind();
然而,當我想更新我需要的單選按鈕的selectedIndex從數據庫中設置一個值的記錄。有一個名爲udt_PageMenuSelection的表,其中有一個名爲menuID的列,它是udt_Menu.menuID的外鍵。
當我想更新現有記錄時,如何將radiolist的selectedindex設置爲等於udt_PageMenuSelection.menuID的值?
我需要做額外的查詢嗎?
感謝 higgsy
什麼表示應該選擇哪個menuID?即你的udt中只有一行? – 2010-08-02 14:56:54