我正面临以下问题。我想要一个带有DropDowList的搜索字段,用户可以在其中选择他想要搜索的项目。我必须使用这个LINQ代码而不仅仅是一个SQL查询。将DropDownList值转换为Linq查询,其中子句为
这里是我的代码:
var Metadata = from m in db.Metadatas
join mm in db.Multimedias
on m.multimediaID equals mm.multimediaID
where (m. { Here would i have the selected value from the dropdownlist. } .ToString().Contains(textboxvalue) ||
mm. { Here would i have the selected value from the dropdownlist. } .ToString().Contains(textboxvalue))
&& mm.filetype.ToString().Contains(radiobuttonvalue)
我希望把这样的:“Dropdownlist.selectedvalue”进入该地区{这里将我从下拉列表选择的值。 }
我希望你们了解我的想法和问题。
你的问题是什么?你永远不会说出来。 – peroija
我想在我所说的地区有我的“dropdownlist.selectedvalue”{这里我会从下拉列表中选择一个值。 } – Haidy