When Convert C# to VB.NET ,LINQ part get the error in VB>.NET but C # Working Fine .

Blow My code paste .


Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports System.Data

Namespace VijaiTesting
Class Program
Private Shared Sub Main(ByVal args As String())
Dim dt As New DataTable("MyTable")
dt.Columns.Add(New DataColumn("Name"))
dt.Columns.Add(New DataColumn("Place"))
dt.Columns.Add(New DataColumn("date", Type.[GetType]("System.String")))

Dim dr As DataRow = dt.NewRow()
dr("Name") = "500"
dr("Place") = "Chennai"
dr("date") = "10-May-2014"
dt.Rows.Add(dr)
Dim dr1 As DataRow = dt.NewRow()
dr1("Name") = "600"
dr1("Place") = "Chennai"
dr1("date") = "11-May-2014"
dt.Rows.Add(dr1)
Dim dr2 As DataRow = dt.NewRow()
dr2("Name") = "200"
dr2("Place") = "Bangalore"
dr2("date") = "12-Aug-2014"
dt.Rows.Add(dr2)
Dim dr3 As DataRow = dt.NewRow()
dr3("Name") = "40"
dr3("Place") = "Chennai"
dr3("date") = "14-May-2014"
dt.Rows.Add(dr3)
Dim dr5 As DataRow = dt.NewRow()
dr5("Name") = "9000"
dr5("Place") = "Bangalore"
dr5("date") = "15-Aug-2014"
dt.Rows.Add(dr5)

Dim dr4 As DataRow = dt.NewRow()
dr4("Name") = "9000"
dr4("Place") = "Bangalore"
dr4("date") = "1-Aug-2014"
dt.Rows.Add(dr4)

Dim grouped = From groupbyUD In From userdefinedtable In dt.AsEnumerable()Group userdefinedtable By New With { _
Key .placeCol = userdefinedtable("Place") _
}New With { _
Key .ValueUD = groupbyUD.Key, _
Key .ColumnValuesUD = groupbyUD _
}

'Variable declare:
Dim place As String = ""
Dim [date] As String = ""
Dim tempTable As New DataTable()
Dim slectedFieldsTable As New DataTable()
Dim newRow As DataRow
Dim list As New List(Of Object)()

'Add Column in DataTable:
slectedFieldsTable = New DataTable()
slectedFieldsTable.Columns.Add("place")
slectedFieldsTable.Columns.Add("date")

For Each keyUD As var In grouped
Console.WriteLine(keyUD.ValueUD.placeCol)
place = DirectCast(keyUD.ValueUD.placeCol, String)

Dim lst As New List(Of DateTime)()
For Each columnValue As var In keyUD.ColumnValuesUD
lst.Add(Convert.ToDateTime(columnValue("date")))
Next
Console.WriteLine(lst.Min())
[date] = DirectCast(Convert.ToString(lst.Min()), String)
' Add Value in DataTable:
slectedFieldsTable.Rows.Add(place, [date])
Next
'Convert DataTable to List:
For Each drin As DataRow In slectedFieldsTable.Rows
list.Add(drin)
Next
'Add Column in another DataTable:
tempTable.Columns.Add("place", GetType(String))
tempTable.Columns.Add("date", GetType(String))

'Convert List to dataTable:
For Each drlst As DataRow In list
newRow = tempTable.NewRow()
newRow("place") = drlst.ItemArray(0).ToString()
newRow("date") = drlst.ItemArray(1).ToString()
tempTable.Rows.Add(newRow)
tempTable.AcceptChanges()
Next
Console.ReadLine()
End Sub
End Class
End Namespace