Click here to Skip to main content
15,897,187 members

Comments by Member 12681421 (Top 8 by date)

Member 12681421 12-Aug-16 9:18am View    
This LINQ query doesn't work :(

This line causes an error:
"ModifiedDate = (DateTime?)a.TableB.ModifiedDate,"

I cannot call TableB from 'a'..
It's strange IMO
Member 12681421 12-Aug-16 8:27am View    
thanks a lot for this!

I'll also try to understand it and maybe simplify it :)
Member 12681421 12-Aug-16 5:03am View    
Really on TableA :)
Member 12681421 12-Aug-16 4:48am View    
I really applied a Primary Key Constraint for UserID in DB but it is not unique. that's it.

Never mind. My problem is to write LINQ query,which is getting MAX of someValue, MAX of otherValue, and Count(*) WITHOUT getting whole list (as I wrote in question)
Member 12681421 12-Aug-16 4:14am View    
sorry I dismiss some information, my fault

a.) TableA
- UserID (PK, int, not null, (but NOT UNIQUE))
- Id (PK,FK, unique)
- CreatedDate (not null)

b.) TableB
- Id (PK, unique)
- ModifiedDate (null)

So 1) I get many rows when I select from TableA for a specific UserId... etc.


In SQL Server Management Studio I got result so query is OK.

Sorry again, for dismiss some information