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

  • Home
  • SEARCH
  • 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 6537301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:36:02+00:00 2026-05-25T10:36:02+00:00

I have this piece of code which is calling some functions in a web

  • 0

I have this piece of code which is calling some functions in a web service. however the original was written in VB and when I have converted it it gives me an error in my c# stating that ‘The name Information does not exist in the current context’ I have checked the VB and it win there either! any thoughts?

Code

try {
        Atlas.ah21 oAh21 = new Atlas.ah21();
        oAh21.session_id = sessionID;
        oAh21.input = txtPostcode.Text;
        oAh21.data = "";
        Atlas.arrayOfAddress oAddresses = oAtlas.ah21(oAh21);

        int x = 0;
        int y = 0;
        string s = null;

    for (x = 0; x <= oAddresses.address.Length - 1; x++)
    {
        s = "";
        for (y = 0; y <= Information.UBound(oAddresses.address(x).LABEL.item); y++)
        {
            if (s.Length > 0)
            {
                s = s + ", ";
            }
            s = s + oAddresses.address(x).LABEL.item(y);
        }
        lstMatches.Items.Add(s);
    }

        txtStatus.Text = "Ready. ";

        if (oAddresses.address.Length > 1) {
            txtStatus.Text = txtStatus.Text + Convert.ToString(oAddresses.address.Length) + " matches found.";
        } else {
            txtStatus.Text = txtStatus.Text + Convert.ToString(oAddresses.address.Length) + " match found.";
        }
} catch {
    txtStatus.Text = "Error";
} finally {
        btnSearch.Enabled = true;
}

Please excuse the amount of code however i think it necessary in the context of this question.

  • 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-05-25T10:36:02+00:00Added an answer on May 25, 2026 at 10:36 am

    I don’t really know VB but i think UBound is just returning the length of the collection so you would do

    for (y = 0; y <= oAddresses.address[x].LABEL.item.Length; y++)
    

    Further to your comment i have realised that address(x) should be address[x]. In c# you only use () for method calls, indexers use []. In VB they both use () i think.

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

Sidebar

Related Questions

I have this little piece of jQuery/jqModal code which works fine. However, I am
I have this piece of code which gives to SAXParseError i.e., it is not
I have this piece of code which I'm hoping will be able to tell
I am somewhat new to R, and i have this piece of code which
I have this piece of code which works 90% of the time: $user_details=$fb->api_client->users_getInfo($fb_user, array('last_name','first_name','proxied_email'));
I have this piece of code which works in Firefox link = $('<a>link</a>'); var
I have this piece of sh code which takes one argument at a time:
I have this piece of code, which copies a plist file to the ApplicationSupport
I have this piece of code, which is not working: BigInteger sum = BigInteger.valueOf(0);
I have this piece of code that works very well and gives me the

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.