Linq Error

This code:
Dim timeformat2 As String = "d/MMM/yyyy"

Select New With {a.CTS = Convert.ToDateTime(a.CT).ToString(timeformat2), a.MD}

Open in new window


Thows this error: 'Anonymous type member name can be inferred only from a simple or qualified name with no arguments'

Has anyone else had this problem/found a solution?

Thanks in advance,

Jonathan
LVL 1
jonathangodwinAsked:
Who is Participating?
 
mikek1966Commented:
To correct this error
•Assign the expression to a member name, as shown in the following code:

CopyDim instanceName2 = New With {.number = numbers(3)}
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.