What is wrong with this Anonymous Object Initializate Syntax?

Posted by Ramiz Uddin on Stack Overflow See other posts from Stack Overflow or by Ramiz Uddin
Published on 2010-04-08T08:28:39Z Indexed on 2010/04/08 8:33 UTC
Read the original article Hit count: 378

Filed under:

What is wrong with this Anonymous Object Initialize syntax?

If (Not row Is Nothing) Then
     Dim info As New CultureInfo(Conversions.ToString(row.Item("cultureId"))) With { _
      .NumberFormat = New With {.CurrencySymbol = Conversions.ToString(row.Item("symbol")),  .CurrencyGroupSeparator = Conversions.ToString(row.Item("thousSep")), .CurrencyDecimalSeparator = Conversions.ToString(row.Item("thousSep")), .CurrencyDecimalDigits = Conversions.ToInteger(row.Item("decimals")), .NumberGroupSeparator = Conversions.ToString(row.Item("thousSep")), .NumberDecimalSeparator = Conversions.ToString(row.Item("thousSep")), .NumberDecimalDigits = Conversions.ToInteger(row.Item("decimals"))}}
     }
     hashtable.Add(key, info)
End If

It is a syntax error or object initialization type casting issue.

Thanks.

© Stack Overflow or respective owner

Related posts about vb.net