Dont know why i cant work it out for myself but
I am JUST looking at Linq and trying to work out what its all about so I am playing with the code - looking at examples etc .
this code should work as i see it - normally you would declare the var category but in all the examples i've seen you dont need to.
But I keep getting "category is undeclared error" on the for each loop
have i mis understood this?
Dim CategoryNames = data.BankAccounts.MainDataSet.Tables("Categorycashflow").AsEnumerable()
Dim db As New DataClasses1DataContext
Dim Categories = db.ExecuteQuery(Of CategoryCashFlowTable)( _
"SELECT [Categorycashflow].month, [Categorycashflow].Cashflow " & _
"FROM Categorycashflow AS
I am JUST looking at Linq and trying to work out what its all about so I am playing with the code - looking at examples etc .
this code should work as i see it - normally you would declare the var category but in all the examples i've seen you dont need to.
But I keep getting "category is undeclared error" on the for each loop
have i mis understood this?
Dim CategoryNames = data.BankAccounts.MainDataSet.Tables("Categorycashflow").AsEnumerable()
Dim db As New DataClasses1DataContext
Dim Categories = db.ExecuteQuery(Of CategoryCashFlowTable)( _
"SELECT [Categorycashflow].month, [Categorycashflow].Cashflow " & _
"FROM Categorycashflow AS
- " & _
"WHERE- .Year = 1993 " & _
"ORDER BY- .Month;")
For Each category In Categories
Console.WriteLine(category)
Next
thanks
Mike
- .Month;")
- .Year = 1993 " & _