title: Method must have return type
body: <p>I keep getting this error when I try to build my solution. I've tried <code>public string</code> and just <code>public</code> but can't get it to work. Any ideas? Thanks!</p>
  
  <pre><code>[WebMethod]
  public static LoadCitiesByState(string state)
  {
          DataTable dt = SharedDataAccess.GetCities(state);
          List&lt;string&gt; cities = new List&lt;string&gt;();
  
          foreach (DataRow row in dt.Rows)
          {
              cities.Add(row[0].ToString());
          }
          return cities;
  
     }
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>Now I get the error: "Not all code paths return a value"</p>
  
  <p><strong>EDIT II</strong></p>
  
  <p>Sorry forgot to paste the try &amp; catch I had in there. I removed them and it worked. If anyone wants to show how to get it to work with a try &amp; catch, feel free though.</p>