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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:32:58+00:00 2026-06-11T12:32:58+00:00

Alright, here’s the deal. I am doing a data conversion where I’m taking data

  • 0

Alright, here’s the deal. I am doing a data conversion where I’m taking data from two databases and putting it into another. I’m adding a list of contacts, and then I’m adding a list of communication records. In order to simplify the process, I made a small array of all of the communication records with the household address of the contacts. Now I’m trying to use a lambda expression to sort out email addresses from the array, but I’m having a problem. The code so far is as follows:

            DataRow[] Comms = dtComms.Select("household_id = " + previousID);

            if (Comms.Where(x => x.Field<string>("communication_type") == "Home Phone").Count() > 0)
            {
                string HomePhone = rNDigits.Replace(Comms[0].Field<string>("communication_value").ToString().Trim(), "");
                if (HomePhone.Length > 6)
                    oAddress._Phone = HomePhone;
            }
            if (Comms.Where(x => x.Field<string>("communication_type") == "Email").Count() > 0)
            {
                string FamilyEmail = rNDigits.Replace(Comms[0].Field<string>("communication_value").ToString().Trim(), "");
                if (FamilyEmail.Contains('@') && FamilyEmail.Contains('.'))
                    oAddress._FamilyEmail = FamilyEmail;
            }

The problem is that obviously, this always will return the first value in the array, which might not always be the one that I want. How can I change the code so that it selects only the value from the array that matches the entry containing the email? Or, is there a better way to search through values in an array?

  • 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-11T12:32:59+00:00Added an answer on June 11, 2026 at 12:32 pm

    I suggesting to use a simple for or foreach loop in this case, LINQ can’t modify data only select it.

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

Sidebar

Related Questions

Alright here's the deal, I'm taking an intro to C++ class at my university
Alright so here are my two tables. CREATE TABLE [cards] ( [id] TEXT PRIMARY
Alright, here I am again trying to write code from scratch and I can't
Alright, here's a quick explanation of what I am doing: I have a website
Alright here's the code: //in another file void **ptr; ptr = kmalloc(sizeof(void *) *
Alright, here's an odd one from an MS Access database I'm running. I have
Alright, so here's the dealio: I'm working on a Ruby app that'll take data
Alright, so here's the deal. I would like to be able to create a
Alright, so what I'm attempting to do here, is select from a datatable all
Alright here it goes. Normally I'm doing alright in HTML, but for this specific

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.