|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
SitePoint Member
Join Date: Oct 2009
Posts: 8
|
ASP.Net 3.5 and Linq with VB.NET
Hi
I am fairly new to asp programming and having a headache with this Linq query: I'm trying to get the average price from a list of prices: from (THIS SHOULD BE A LINK) MSDN: How to: Count, Sum, or Average Data by Using LINQ (Visual Basic) I understand i have to write the code like this: dim averagePrice = Aggregate price In db.items Into Average() I have also tried with: dim countPrice = Aggregate price In db.items Into Count() Wich works fine! dim sumPrice = Aggregate price In db.items Into Sum() Wich dont work at all! as for the sum try i understand i have to have something in the parentheses of Sum() but i have no clue of what to have there. As I said i'm fairly new to this. ywndotno |
|
|
|
|
|
#2 |
|
SitePoint Member
Join Date: Oct 2009
Posts: 8
|
managed to solve by help from a classmate
![]() Dim snitt = Aggregate eierskaps In db.eierskaps Into Average(eierskaps.filmPris) |
|
|
|
![]() |
| Bookmarks |
| Tags |
| linq |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 14:10.









Hybrid Mode
