I am having trouble binding some data from my MySQL database to a DataGridView in C# Windows Forms.
I have 2 tables, referenced by a foreign key in one table, and I want to do a JOIN
between the 2 tables and bind that to my DataGridView. I have tried adding a new datasource from a DataSet, but that only allows to add 1 table in the datagridview (as far as I can tell).
Next I wanted to create a Entity Framework model and bind that to the DataGridView. I have created a new model named Model1
, but the model is not accessible anywhere in my code. Is there something wrong with my logic?
I have also tried (after creating the model) to create a DataSource from an object (trying to select the model as the object, but it wasn't visible in the wizard).
Or is there another way to bind a simple LEFT JOIN
into a DataGridView?