473,322 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

And another LINQ 101 bug...

Here is another one I hope somebody can help me with, this is the
AnyGrouped example and does not recognise the 'Group' as being valid :

List<Productproducts = GetProductList();

var productGroups =
from p in products
group p by p.Category into g
where g.Group.Any(p =p.UnitsInStock == 0)
select new { Category = g.Key, Products = g.Group };

foreach (var a in productGroups)
{
lbl.Text += a.Category + ":<br/>";

foreach (var b in a.Products)
{
lbl.Text += b + "<br/>";
}
}

*** Sent via Developersdex http://www.developersdex.com ***
Aug 22 '08 #1
5 1121
On Aug 22, 8:47*am, Mike P <mike.p...@gmail.comwrote:
Here is another one I hope somebody can help me with, this is the

These LINQ query errors remind me of SQL query errors--being off by a
parens or one small token is fatal. Good luck. It's a real dinosaur
construct (LINQ and SQL) IMO.

RL
Aug 22 '08 #2
On Fri, 22 Aug 2008 08:47:18 -0700, Mike P <mi*******@gmail.comwrote:
Here is another one I hope somebody can help me with, this is the
AnyGrouped example and does not recognise the 'Group' as being valid :
Again, hard to say without seeing the actual sample. But what happens if
you replace "g.Group" with simply "g"?

Pete
Aug 22 '08 #3
raylopez99 wrote:
On Aug 22, 8:47 am, Mike P <mike.p...@gmail.comwrote:
>Here is another one I hope somebody can help me with, this is the

These LINQ query errors remind me of SQL query errors--being off by a
parens or one small token is fatal. Good luck. It's a real dinosaur
construct (LINQ and SQL) IMO.
What do you code in where being off by one parenthesis does not matter ?

Arne
Aug 23 '08 #4
On Aug 22, 6:41*pm, Arne Vajhøj <a...@vajhoej.dkwrote:
These LINQ query errors remind me of SQL query errors--being off by a
parens or one small token is fatal. *Good luck. *It's a real dinosaur
construct (LINQ and SQL) IMO.

What do you code in where being off by one parenthesis does not matter ?
Yes, I thought of this after I posted. What I'm trying to say is that
some languages are more forgiving than SQL, which tries to pack too
much into one line. Kind of like if / else statements that are
nested--sometimes it's better to have a case statement. But it's just
my newbie opinion.

RL
Aug 23 '08 #5
Here is the link to the example :

http://msdn.microsoft.com/en-us/vcsh...spx#anyGrouped

*** Sent via Developersdex http://www.developersdex.com ***
Aug 26 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Dave Johnson | last post by:
Greetings, i want to be able to use linq new technology with sql server. the senario i am not able to do so far is as follow: 1- i program with linq 2- be able to generate and manipulate...
4
by: cj | last post by:
Can I use LINQ in VB .Net 2008 to get to a Visual FoxPro Table? I've seen demos of it with SQL Server but they've used it with a server browser and I don't think that'd work when I need to see VFP...
9
by: =?Utf-8?B?cmF1bGF2aQ==?= | last post by:
Hi all: after reading different places/sites about linq... I ran into these questions: 1. What framework do we need to run linq ? (does it depend on what version of visual studio we have?) how...
0
by: =?Utf-8?B?SHlwZXJjb2Rlcg==?= | last post by:
I'm encountering some strange behavior after deploying a ASP.net 3.5 website to production, i'm unable to reproduce these in my dev environment. This error seems to occur very randomly but it's...
4
by: =?Utf-8?B?RXJpYyBGYWxza2Vu?= | last post by:
We’re storing our main entity in an insert only table which stores the history of past revisions, but we’re facing problems with storing this history as LINQ will only update the entity, and...
14
by: thj | last post by:
Hi, I was wondering what you guys are using and why? LINQ to SQL or NHibernate? Thanks in advance, Tommy
9
by: Cirene | last post by:
I'm about to begin a brand new, big, ASP.NET project (using 3.5 .net fw), VS 2008. I'm using MySQL as the backend (customer request.) I have absolutely no experience with LINQ and/or the Entity...
3
by: =?Utf-8?B?UGF1bCBQcmV3ZXR0?= | last post by:
I'm attempting to use LINQ to insert a record into a child table and I'm receiving a "Specified cast is not valid" error that has something to do w/ the keys involved. The stack trace is: ...
4
by: George | last post by:
I am a bit conservative type and usually give some time for technology to mature before starting to try it. Today my question is Linq. To start using it or not. So here is the voting questions....
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.