When I use the following code the error occurs
testtelContext db = new testtelContext();
var qry = (from p in db.firstlasts
join i in db.firstnames
on p.Idfname equals i.Idfname
select new
{
id = p.idfl,
name = i.fname
}).ToList();
bindingSource3.DataSource = qry;
dataGridView5.DataSource = bindingSource3;
bindingSource3.AddNew();
Errors in the use bindingSource3.AddNew();
error:AddNew cannot be called on the '<>f__AnonymousType12[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' type. This type does not have a public default constructor. You can call AddNew on the '<>f__AnonymousType1
2[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' type if you set AllowNew=true and handle the AddingNew event.
AddNew
is pointless. – leppie