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 6345267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:47:24+00:00 2026-05-24T20:47:24+00:00

Actually i am working on a sample code of my own trail where i

  • 0

Actually i am working on a sample code of my own trail where i enter a mobile number and click on buttonso that a form will open on that form i would like to show the name of that coresponding number from the string[] array available in the form

Assume i have

string[] User = { "XYZ", "ABC", "DEF" };
string[] Number = { "1234567890", "2345678901", "345678901" };

Assume i enter 1234567890 and click on enter i would like to display the corresponding name from the list avialable i.e XYZ.

I don’t know whteher i explain my problem clearly or not but it is similar to the finding the contact available.

Any better method please let me know..

  • 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-24T20:47:25+00:00Added an answer on May 24, 2026 at 8:47 pm

    Use Dictionary<long, string> is what you need here.

    Dictionary<long, string> nameFromNumber = new Dictionary<long, string>();
    
    nameFromNumber.Add(1234567890, "XYZ");
    nameFromNumber.Add(2345678901, "ABC");
    ...
    

    Then to find the name of the inserted number you can do:

    long numberToCheck = 12364567890;
    if (nameFromNumber.ContainsKey(numberToCheck)//Contains(numberToCheck)
    {
        string name = nameFromNumber[numberToCheck];
        ...
    }
    

    Edit: change the signature to long instead of int, thanks to @Kirill how pointed this out, Anyway I personally would use string instead so my method will accept more generic format of numbers such as 012-3456789

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

Sidebar

Related Questions

Actually I'm working with BufferedImages, that provide me pixel values in int type. Do
I've got an ASP document that 5 years old. Actually I'm working with PHP
I'm working on some code which fills a GridView full of images that have
I'm working on a simple ASP.Net page (handler, actually) where I check the value
I'm actually working at MOSS 2007 project where I have to import data from
I am actually working on SP in SQL 2005. Using SP i am creating
Actually I have a file . I am working in linux environment. I need
I'm working on designing the kernel (which I'm going to actually call the core
I am working with a set of what is essentially Attribute/Value pairs (there's actually
I'm working on a WTL project, actually WTL 8.1 with VS2008. In many tutorials

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.