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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:03:48+00:00 2026-05-23T18:03:48+00:00

Definition of my Class Public Class ProcessAlert Public LoanNumber As String Public EmailAddress As

  • 0

Definition of my Class

    Public Class ProcessAlert
       Public LoanNumber As String
       Public EmailAddress As String
       Public AlertType As String
       Public AlertMethodID As Byte
    End Class

A generic list that is representative of data returned from DB

     Dim a As New List(Of ProcessAlert)

     a.Add(New ProcessAlert("0000112367", "5551110000@txt.att.net", "Alert", 2))
     a.Add(New ProcessAlert("0000112367", "5551110000@txt.att.net", "Document", 2))
     a.Add(New ProcessAlert("0000112367", "5551110000@txt.att.net", "Note", 2))
     a.Add(New ProcessAlert("0000112367", "jdoe@home.com", "Alert", 1))
     a.Add(New ProcessAlert("0000112367", "jdoe@home.com", "Document", 1))
     a.Add(New ProcessAlert("0000112367", "jdoe@home.com", "Note", 1))

     Return a

I managed this LINQ statement that will group by LoanNumber and EmailAddress but I can’t get the AlertType to show up as a concatenated field of all 3 values

     Dim res = Alerts.GroupBy(Function(g) New With {Key .A = g.LoanNumber, Key .B = g.EmailAddress}) 

This code will give me a grouping by EmailAddress and the values I need of:
“jdoe@home.com”, “Alert, Document, Note”
“5551110000@txt.att.net”, “Alert, Document, Note”

    Dim res = Alerts.GroupBy(Function(i) i.EmailAddress).Select(Function(g) New KeyValuePair(Of String, String)(g.Key, String.Join(",", g.Select(Function(x) x.AlertType).ToArray())))

But I cannot seem to get the statement give me a return that looks like this:

    "0000112367","jdoe@home.com", "Alert, Document, Note"
    "0000112367","5551112222@txt.att.net", "Alert, Document, Note"

How do I get 2 fields to group and then concatenate the values of AlertType into a single field???

Thanks in advance

  • 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-23T18:03:48+00:00Added an answer on May 23, 2026 at 6:03 pm

    Are you looking for something like this:

    From _a In a
    Group _a.AlertType By _a.LoanNumber, _a.EmailAddress Into Group
    Select New With
    {
        .LoanNumber = LoanNumber,
        .EmailAddress = EmailAddress,
        .AlertTypes = String.Join(", ", Group.ToArray())
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Impossible recursive generic class definition? I just discovered that public class Foo<T>
Lets assume following classes definition: public class A { public final static String SOME_VALUE;
Given a simple C# class definition like: [System.Windows.Markup.ContentProperty(PropertyOne)] public class SimpleBase { public string
Assuming the following view model definition: public class MyObject { public string Name {
I have the following VB.NET class definition: <Serializable()> Partial Public Class Customers End Class
I have a class definition that looks like this: public class SolrObj { [SolrUniqueKey(id)]
This is my list definition public class EventsList { public int EventID { get;
This is my list definition public class EventsList { public int EventID { get;
Given a generic class definition like public class ConstrainedNumber<T> : IEquatable<ConstrainedNumber<T>>, IEquatable<T>, IComparable<ConstrainedNumber<T>>, IComparable<T>,
I have the following class definition: public static string SplitString(string someText) { var queryArray

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.