Explaining with my code will be infinitely easier, so;
private void dtSelectorLoad_Click(object sender, RoutedEventArgs e)
{
MessageBox.Show(dtSelector.SelectedValue != null ? dtSelector.SelectedValue.ToString() : "I have 0 selected items!");
var query =
from obj in dataEntities.someTable
select obj;
primaryDataGrid.ItemsSource = query.ToList();
}
Essentially, based on the value of the dtSelector.SelectedValue.ToString(); I need to execute the from obj in dataEntities.someTable where someTable is the value of dtSelector.SelectedValue.ToString();.
How can I achieve this? Banging my head against the wall here. End-game is that when the user clicks the button, it populates a dataGrid with data from the table currently selected in the listBox.
dataEntities? Is it an Entity FrameworkDbContextanddtSelector.SelectedValuedetermines theDbSetto query?