我可以使用RadioButtonList
中的中的選定值從IQueryable
中獲取選定值嗎?IQueryable with RadioButtonList.SelectedValue
我已經RadioButtonList
與DataValueField="Code"
我的代碼是
public IQueryable<Tbl_name> GetValuesfromTable()
{
return dbo.Tbl_name.Where(q => q.Code = (RadioButtonList.SelectedItem.Value)).OrderBy(c => c.Date_publication);
}
請你能幫助我查詢?
爲什麼你需要'OrderBy'?你是否收到錯誤?什麼錯誤? –
它實際上工作:返回dbo.Tbl_name.Where(q => q.Code == 1)。排序是沒有必要的..但是我不能使用RadioButtonList的值... – Peter
當您嘗試使用RadioButtonList的值時會發生什麼? –