为什么代码不显示任何内容datagridview
?
class classman
{
public int id;
public string name;
}
private void Form2_Load(object sender, EventArgs e)
{
testtelContext db = new testtelContext();
List<classman> qry = (from p in db.firstlasts
join i in db.firstnames
on p.Idfname equals i.Idfname
select new classman
{
id = p.idfl,
name = i.fname
}).ToList();
BindingSource bs=new BindingSource();
bs.DataSource = qry;
dataGridView1.DataSource = bs;
}
bindingsource 有值但不显示 dataGridView5 显示图片http://irphoto.ir/uploads/13658793021.jpg