title: How can I get a column value from selected database object in ListBox?
body: <p>First, I must say that I am new to LINQ and WPF.</p>
  
  <p>I have a 'Students' table in database that contains information about students (name, id, etc.).
  I want to get an information about a student that was selected in the ListBox on MainForm.</p>
  
  <pre><code>var students = from s in db.Students select s;
  listBox.DisplayMemberPath = "name"; 
  listBox.ItemsSource = students;
  </code></pre>
  
  <p>I put all the information about students into <code>var student</code>. I want only the <code>name</code> of the student to be shown in the ListBox. Is there any way to get a value of <code>id</code> column from <code>var students</code> without query to database?
  I mean something like that:</p>
  
  <pre><code>var id = listBox.SelectedItem.getValue("id");
  </code></pre>