How can I write this query with LINQ in a FoxPro database?
SELECT count(*) FROM Table group by item1
I wrote it as shown below, but it does not work
Dim Query
Dim dt As New DataTable
Dim da = New Odbc.OdbcDataAdapter("SELECT * FROM table1",connection)
da.Fill(dt)
Query = (From row In dt.AsEnumerable Select row_
Group By item1 = row.Item(6) Into_
count = Count(row.Item(6))).ToList
The following line works:
Dim q = From p In dt Group p By item = p.Item(6) Into count = Count()
How to link the results of the above query with a GridView? Unfortunately, the installation q, because the DataSource is not working
grid.DataSource= q
I found that I shoud binds it that way
Dim table As DataTable = q.ToDataTable()
DataGridView1.DataSource = table
but i'm so wrong
'copytodatatable' is not a member of 'System.Collections.Generic.IEnumerable
What does this error refer to?
Mahsa source
share