title: Binding a DataSet to Listbox
body: <p>I want to bind the results of an SQL query to a Listbox of an WPF interface. As many examples I have seen, I cannot tweak my application, so as to work properly. I use this code behind: </p>
  
  <pre><code>string sqlStr1 = "SELECT Players.LastName FROM Players";
  
  SqlDataAdapter dAdapt1 = new SqlDataAdapter(sqlStr1, cnStr);
  DataSet dataSet1 = new DataSet();
  dAdapt1.Fill(dataSet1);
  
  List1.DataContext = dataSet1;
  </code></pre>
  
  <p>and in the xaml page:</p>
  
  <pre><code>&lt;ListBox Name="List1" Grid.Column="1" Grid.Row="2" &gt;&lt;/ListBox&gt;
  </code></pre>
  
  <p>What is the way to bind them so as the name to appear in the Listbox?</p>
  
  <p>Without adding any Binding in the xaml page, it throws an exceprtion when I try to run it. What is wrong?</p>