Click here to Skip to main content
15,887,683 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: VB.Net 2008 Pin
Richard MacCutchan16-May-14 0:50
mveRichard MacCutchan16-May-14 0:50 
GeneralRe: VB.Net 2008 Pin
Virendra Singh Bhanu16-May-14 0:56
Virendra Singh Bhanu16-May-14 0:56 
GeneralRe: VB.Net 2008 Pin
Richard MacCutchan16-May-14 1:14
mveRichard MacCutchan16-May-14 1:14 
QuestionRe: VB.Net 2008 Pin
Eddy Vluggen16-May-14 3:02
professionalEddy Vluggen16-May-14 3:02 
QuestionList(Of ObjectWithProperties) distinct property values Pin
Johan Hakkesteegt15-May-14 3:32
Johan Hakkesteegt15-May-14 3:32 
AnswerRe: List(Of ObjectWithProperties) distinct property values Pin
Richard MacCutchan15-May-14 3:49
mveRichard MacCutchan15-May-14 3:49 
AnswerRe: List(Of ObjectWithProperties) distinct property values Pin
David Mujica15-May-14 6:32
David Mujica15-May-14 6:32 
AnswerRe: List(Of ObjectWithProperties) distinct property values Pin
Eddy Vluggen15-May-14 7:53
professionalEddy Vluggen15-May-14 7:53 
Johan Hakkesteegt wrote:
Each of these 5 employees are member of one of 10 possible different departments. Perhaps they are each member of a different department, perhaps
they are all members of the same department, etc. This is an unknown.
One employee in one department, not one employee in multiple departments. Check.

VB
Imports System.Collections.Generic
Module Module1

    ' Let's say that I have an object called Employee with the properties Name and Department.
    Class Employee
        Public Property Name As String
        Public Property Department As String
    End Class

    Sub Main()

        Dim zeList As New List(Of Employee)
        zeList.Add(New Employee() With {.Name = "John", .Department = "IT"})
        zeList.Add(New Employee() With {.Name = "Jane", .Department = "IT"})
        zeList.Add(New Employee() With {.Name = "Pete", .Department = "Management"})

        Dim departments As IEnumerable(Of String) = zeList.Select(Function(e) e.Department).Distinct()

        For Each department As String In departments
            Console.WriteLine(department)
        Next
        Console.ReadLine()

    End Sub

End Module

Bastard Programmer from Hell Suspicious | :suss:
If you can't read my code, try converting it here[^]

GeneralRe: List(Of ObjectWithProperties) distinct property values Pin
Johan Hakkesteegt15-May-14 20:16
Johan Hakkesteegt15-May-14 20:16 
GeneralRe: List(Of ObjectWithProperties) distinct property values Pin
Mycroft Holmes15-May-14 22:41
professionalMycroft Holmes15-May-14 22:41 
QuestionWindow Service Does Not Stay "Alive" While Running Pin
ToolTimeTabor14-May-14 15:13
ToolTimeTabor14-May-14 15:13 
AnswerRe: Window Service Does Not Stay "Alive" While Running Pin
Bernhard Hiller14-May-14 21:51
Bernhard Hiller14-May-14 21:51 
AnswerRe: Window Service Does Not Stay "Alive" While Running Pin
Eddy Vluggen15-May-14 3:00
professionalEddy Vluggen15-May-14 3:00 
AnswerRe: Window Service Does Not Stay "Alive" While Running Pin
David Mujica15-May-14 6:25
David Mujica15-May-14 6:25 
QuestionIf/and Statements Pin
David Rubin13-May-14 12:34
David Rubin13-May-14 12:34 
AnswerRe: If/and Statements Pin
Peter Leow13-May-14 14:33
professionalPeter Leow13-May-14 14:33 
AnswerRe: If/and Statements Pin
charliedev14-May-14 19:20
charliedev14-May-14 19:20 
Questionsave images as .gif Pin
khei-chan00712-May-14 17:44
khei-chan00712-May-14 17:44 
AnswerRe: save images as .gif Pin
Chris Quinn12-May-14 20:56
Chris Quinn12-May-14 20:56 
GeneralRe: save images as .gif Pin
khei-chan00712-May-14 21:25
khei-chan00712-May-14 21:25 
GeneralSaving Image as Gif Pin
I. Bandaranayake13-May-14 1:49
I. Bandaranayake13-May-14 1:49 
AnswerRe: save images as .gif Pin
Richard MacCutchan12-May-14 22:47
mveRichard MacCutchan12-May-14 22:47 
QuestionMapWinGis project in Visual Basic.NET Pin
Member 1081056711-May-14 7:32
Member 1081056711-May-14 7:32 
QuestionVB CODE TO RECEIVE SMS THROUGH GSM MODEM Pin
elly ianto10-May-14 2:34
elly ianto10-May-14 2:34 
AnswerRe: VB CODE TO RECEIVE SMS THROUGH GSM MODEM PinPopular
Dave Kreskowiak10-May-14 3:38
mveDave Kreskowiak10-May-14 3:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.