473,385 Members | 1,693 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,385 software developers and data experts.

Re: Need some LINQ love

Roshawn wrote:
Hi,

'error happens on the line below
brands = db.Brands.Where(Function(b) b.Products(0).Merchant.name =
myMerchant AndAlso b.Products.Count 0).ToList
This code totally bombed. A System.NotSupportedException is thrown,
stating, "Method 'Product get_Item(Int32)' has no supported
translation to SQL"
I could be way off, so take this with a grain of salt.

I would first remove the (0) after Products; then I would specify a property for
myMerchant, i.e. name.

That would give
brands = db.Brands.Where( _
Function(b) b.Products.Merchant.name = myMerchant.name _
AndAlso b.Products.Count 0 _
).ToList

I don't know if it is valid LINQ, but it makes more sense to me, anyway.
Jun 27 '08 #1
1 1411
Thanks for the reply, Steve. Sorry I took so long to respond but I've been busy with
other things...

As for the code you provided, it didn't work. When I remove the "(0)" after Products, all
Intellisense gives me are properties and methods associated with EntitySet(Of Product).
There is no mention of the Merchant EntitySet anywhere.

But thanks anyway. I'll keep trying, and when I get it, I'll share it here.
Jun 27 '08 #2

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...
1
by: shapper | last post by:
Hello, I have been reading a few articles about LINQ and I have a few questions: 1. What do I need to start using it in my ASP.NET 2.0 / SQL 2005 / Visual Studio 2005 web sites? 2. Is...
0
by: fiona | last post by:
Reading, Berkshire, UK 05 June 2007 - Crainiate Software make details available of the release of Objecto Framework 2.0, an upgrade to their enterprise business component framework, designed to...
3
by: plonk | last post by:
Hi I'm trying to learn sql by getting a database up and running on VB.net 2008 and SQL server express. I have the database connected correctly, (i think) but when i try to add a record using this...
0
by: Roshawn | last post by:
I'm thinking that I need another table that maps merchants to brands, something like a many-to-many table. Would that work?
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...
2
by: Tom P. | last post by:
I'm not getting the theory behind LINQ, and without that I can't get my head around how to use it and why. Here's what I _think_ I'm trying to do: I've got a menu with several items. Some other...
21
by: hrishy | last post by:
Hi Will LINQ be ported to Python ? regards Hrishy
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...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.