---Dim query = _
From order In orders.AsEnumerable() _
Where order.Field(Of DateTime)("OrderDate") > New DateTime(2001, 8, 1) _
Select order
' Create a table from the query.
Dim boundTable As DataTable = query.CopyToDataTable()
I found the above code from MSDN. I wonder why I can't see CopyToDataTable method available from my copy of vb.net 2008 express version's intellisense. Did I miss on something? I have add referece to and imports system.data.linq and system.data.dlinq!!!
Also, I tried coding as the follow:
Dim fgrid As DataTable = ds.Tables("toy")
Dim l As Object
For i = 0 To strcval.Length - 1
Dim j As Integer = i
Dim query = From order In fgrid.AsEnumerable() Where Select New With {.s = order("subHead"), .g = order("gpt")}
For Each l In query
Console.WriteLine("{0}", l.g.ToString) <----error falls on this line
Next
Next
I am guessing that my code in the WHERE clause---fgrid("vocab").It
em("vocab"
).ToString
= strcval (j).ToString is causing the error...Do you know how to place a string array item or a string variable as the filter value to equals to column content of source datatable?
Start Free Trial