title: only assignment, call, increment, decrement, await and new object expressions can be used as a statement
body: <p>I have converted 4,000 lines of code from VB.net to c#... I am totally tripped up on this one problem.   This keeps giving me the error that "Only assignment, call increment, decrement, await, and new object expressions can be used as a statement"</p>
  
  <p>Any help on what the error is here?  It also is throwing an error that a query body must end with a select clause or a group clause.</p>
  
  <pre><code>protected static string AssembleArgumentString(Dictionary&lt;string, string&gt; @params,   bool urlEncode)
  {
     if (urlEncode) {
       return string.Join("&amp;", (from kv in @params where !string.IsNullOrEmpty(kv.Value)kv.Key + "=" + System.Web.HttpUtility.UrlEncode(kv.Value)).ToArray);
     } 
     else {
       return string.Join("&amp;", (from kv in @params where !string.IsNullOrEmpty(kv.Value)kv.Key + "=" + kv.Value).ToArray);
     } 
   }
  </code></pre>