I am trying to write a linq query and having a fit trying to figure it out. Am not very good with linq, just the basics. I code in vb. So I created a datatable in code, then want to write a query that joins it to a typed datatable. Here is what i have so far:
I have tried a.field(of integer)("cctrid") and many other things, but I keep getting a type expected error.
Dim dt As New DataTable dt.Columns.Add("cctrid", gettype(integer)) .......Add some rows to dt here. Dim query = From a In dt Join b In EMS_DS.TEMSCCTR On a.cctrid Equals b.cctr_id Group By a.cctrid Into cctrcnt = Count(a.cctrid) Select a.cctrid, cctrcnt cctrgc.datasource=query End Sub