1 | initial version |
One way to resolve this error is to convert the DataTable to an IEnumerable using LINQ and then bind it to the WPF control. Here is an example:
var data = dataTable.AsEnumerable().ToList();
listBox.ItemsSource = data;
Make sure the type of the control's ItemsSource property is set to "IEnumerable" or "IEnumerable<t>".