在WPF解决方案中,我有一个带复选框列的DataGrid。
每次用户检查一行时,它将“ CODE”列的数据存储在列表框中。
private void Choix_Ckb_Checked(object sender, RoutedEventArgs e)
{
object id = ((CheckBox)sender).CommandParameter;
string artCode = Convert.ToString(id);
ArtCode_ListBox.Items.Add(artCode);
}
现在,假设用户正在检查前3行,然后单击DataGrid下方的按钮以验证选择。我想执行这样的LinqTosql查询:
private void Valid_SelectedRow_Btn_Click(object sender, RoutedEventArgs e)
{
using (Model1Container dc = new Model1Container())
{
#region Query
var valnut = from v in dc.GCART_DECLAR_NUTRITION
join art in dc.GCARTICLE on v.ADN_CODE equals art.ART_CODE
where v.ADN_CODE = // 50160100203 && where v.ADN_CODE = 501601001027 && where v.ADN_CODE = 501601001033
select new
{
v.ADN_CODE,
energie = v.ADN_EKJ_UNIT ?? 0,
};
}
}
如何正确编写“ where”语句? 感谢您的帮助。