Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8396029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:26:29+00:00 2026-06-09T20:26:29+00:00

I have converted 4,000 lines of code from VB.net to c#… I am totally

  • 0

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”

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.

protected static string AssembleArgumentString(Dictionary<string, string> @params,   bool urlEncode)
{
   if (urlEncode) {
     return string.Join("&", (from kv in @params where !string.IsNullOrEmpty(kv.Value)kv.Key + "=" + System.Web.HttpUtility.UrlEncode(kv.Value)).ToArray);
   } 
   else {
     return string.Join("&", (from kv in @params where !string.IsNullOrEmpty(kv.Value)kv.Key + "=" + kv.Value).ToArray);
   } 
 }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T20:26:30+00:00Added an answer on June 9, 2026 at 8:26 pm

    You need a select clause in your LINQ query. For example:

    return string.Join("&", (from kv in @params where !string.IsNullOrEmpty(kv.Value) select kv.Key + "=" + kv.Value).ToArray());
    

    Also, don’t forget the () at the end of the ToArray method call. You actually don’t even need the ToArray() because String.Join() can take an IEnumerable as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have converted an array to object data like this: <?php $myobject->data = (object)Array('zero','one','two');
I have this value, 2011-11-19T00:00:00.000-03:00 which needs to be converted and set it in
Problem: I have an address field from an Access database which has been converted
i have converted a vb6 ocx to C# com control. this com control is
I have converted ILColorPicker to work on XCode4 and Storyboard. My problem is that
I have a collection of about 10,000 small VBScript programs (50-100 lines each) and
Here is the problem: I have one giant string of xml data stored in
I have the following SQL code: select val.PersonNo, val.event_time, clg.number_dialed from vicidial_agent_log val join
I have Date in this format (2012-11-17T00:00:00.000-05:00). I need to convert the date into
I've just converted a project from .net 1.1 to 3.5, and I'm being given

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.