Help to translate from C# to VB

2 posts, 0 answers
  1. Peer
    Peer avatar
    3 posts
    Member since:
    Aug 2015

    Posted 18 Aug 2015 Link to this post


     I need help, to translate a working C# kode til vb. It's the code highlightet with yellow, that gives me some (all the) troubles:

            private void ReadAppointmentsFromDatabase()



                var appointments = new ELHedegaard.BLL.Appointment(); 

                foreach (var appointment in appointments.GetAppointmentsWithResources())


                    Appointment schedulerAppointment = new Appointment();

                    schedulerAppointment.Summary = appointment.Summary;

                    schedulerAppointment.Start = appointment.Start.Value;

                    schedulerAppointment.End = appointment.End.Value;

                    schedulerAppointment.Location = appointment.Location;

                    schedulerAppointment.Description = appointment.Description;

                    //schedulerAppointment.BackgroundId = 1;

                    schedulerAppointment.StatusId = 2;

                    schedulerAppointment.BackgroundId = appointment.ParentID.Value;

                    foreach (var x in appointment.ResourceIds.Select(a => new EventId(a)))










    Kindly Peer​

  2. Stefan
    Stefan avatar
    2908 posts

    Posted 18 Aug 2015 Link to this post

    Hi Peer,

    You can have a look at our online converter as well as this thread on StackOverflow:

    In general, it should be something like this:
    For Each x As EventId In _appointment.ResourceIds.Select(Function(a) New EventId(a))

    I hope this helps.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top