I'm learning about Entity SQL but I'm having some problem about how to code, I found on the Internet that most of the code they're all written like this.
ObjectQuery<EntitiesName> example = new ObjectQuery<EntitiesName>(query);
ObjectQuery<EntitiesName> example2 = context.CreateQuery<EntitiesName>(query);
So that mine problem, I'm using Entity Framwork 6.1.3, Visual 2013 and SQL 2014. I try to write like that but it won't use. Then i found on the Internet this type of code.
ObjectQuery<EntitiesName> exm = ((IOContextAdapter)context).ObjectContext.CreateQuery<EntitiesName>(query);
I don't understand because the different of EF version or my visual, sql don't support that. And another problem is I'm writing on Winform C# but when I type :
dataGridView.DataSource = context.ToList();
It says that System.data.entity.core.objects.objectquery does not contain definition for ToList().
Click here to see the picture of problems
Hope can get the answer soon, thank you !