I want to bind a MySQL database to my WPF GridView.
But this doesn’t work. I would like to do this:
MySqlDataAdapter adapter = new MySqlDataAdapter(query, connection);
MySqlCommandBuilder builder = new MySqlCommandBuilder(adapter);
DataTable table = new DataTable();
adapter.Fill(table);
BindingSource source = new BindingSource();
source.DataSource = table;
areaDataGrid.DataContext = table;
But the gid is empty. Why?
You need to set the
ItemsSourceproperty