【发布时间】:2015-11-26 01:42:30
【问题描述】:
我有一个问题,即如何使用数据库中的数据填充列表框,而无需 db 列和大括号 这是我的代码:
var db = new DataClasses1DataContext();
var history =( from a in db.ResultsHistories
where
a.PlayerOne == _playerOne && a.PlayerTwo == comboBox.Text ||
a.PlayerTwo == _playerOne && a.PlayerOne == comboBox.Text
select new
{
a.PlayerOne,
a.PlayerTwo,
a.Date,
a.ResultOne,
a.ResultTwo
}).ToList();
listBox.ItemsSource = history;
【问题讨论】:
标签: c# wpf linq-to-sql