I am using Entity Framework to work with a simple table. How do I bind a DataGridView to a table?
Printable View
I am using Entity Framework to work with a simple table. How do I bind a DataGridView to a table?
You don't. You bind to a list of some sort. You query your EF context in an appropriate manner and then call ToList or ToArray on the result to get a generic List or an array, then you bind that to your DataGridView, preferably via a BindingSource. If you want to be able to add and remove items, a List would be the better option.
Thanks! I'll try that.