title: "There was an error parsing the query. [Token line number = 1, Token line offset = 52,Token in error = Data]"
body: <p>I am trying to select a set of data for a ComboBox based on the selection of the previous ComboBox. I have been lead to believe it is the SELECT statement in the second method, but I cannot figure out why it isn't working. When I run the application I receive this error: "There was an error parsing the query. [Token line number = 1, Token line offset = 52,Token in error = Data]" I have attempted using Parameter.AddWithValue, cmd.Parameters.Add, and also setting the value as a string to no avail. Would anyone mind teaching me how to correctly resolve this? Thank you.</p>
  
  <p>The setup of the database is as follows:</p>
  
  <p>Cities</p>
  
  <ul>
  <li>CityId (PK, int, not null)</li>
  <li>Name (nchar(20), null)</li>
  <li>rowguid (uniqueidentifier, not null)</li>
  </ul>
  
  <p>Parks</p>
  
  <ul>
  <li>ParkId (PK, int, not null)</li>
  <li>CityId (FK, int, not null)</li>
  <li>Name (nchar(30), null)</li>
  <li>rowguid (uniqueidentifier)</li>
  </ul>
  
  <p>Here is the method:</p>
  
  <pre><code>private void cboCities_SelectedIndexChanged(object sender, EventArgs e)
  {
      if (cboCities.SelectedIndex &gt; -1)
      {
          SqlCeConnection cn = new SqlCeConnection(@"Data Source = \Program Files\ParkSurvey\ParkSurvey.sdf; Persist Security Info = False; Password = *");
          cn.Open();
          SqlCeCommand cmd = cn.CreateCommand();
          cmd.CommandText = "SELECT Name FROM [Parks] WHERE CityId =" + cboCities.SelectedValue + "ORDER BY Name ASC";
          SqlCeDataAdapter da = new SqlCeDataAdapter(cmd);
          DataSet ds = new DataSet();
          da.Fill(ds);
          cn.Close();
          cboParks.ValueMember = "ParkId";
          cboParks.DisplayMember = "Name";
          cboParks.DataSource = ds.Tables[0];
          cboParks.SelectedIndex = -1;
      }
  </code></pre>