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

Linq alias in for each loop

I have some linqtosql

Dim col = (From cd In ctx.TBLContactData _
Join cc In ctx.TBLCompanyContacts On cc.CompanyContactID
Equals
cd.CompanyContactID _
Select test = cc.CompanyContactID).Skip(0).Take(10)
When I loop through the collection
For Each colobj In col
'I want be able to write col.test but this does work
It's important that I can reference cc.CompanyContactID as an alias.
Sep 17 '08 #1
2 1170
Hi, I answered in the vb group.

Please avoid multiposting (i.e. posting the same question in multiple groups
separately). Cross post (i.e. post the same question in multiple groups at
the same time so that this post is tracked accross groups) only when really
needed. In this particular case, ASP.NET doesn't have anything to do in the
problem....

--
Patrice

<ch***********@peninsula-uk.coma écrit dans le message de groupe de
discussion :
a7**********************************...oglegroups.com...
I have some linqtosql

Dim col = (From cd In ctx.TBLContactData _
Join cc In ctx.TBLCompanyContacts On cc.CompanyContactID
Equals
cd.CompanyContactID _
Select test = cc.CompanyContactID).Skip(0).Take(10)
When I loop through the collection
For Each colobj In col
'I want be able to write col.test but this does work
It's important that I can reference cc.CompanyContactID as an alias.

Sep 17 '08 #2
Sorry about that. Could you post the answer here as well as it isn't showing
up in the other group. Cheers.

"Patrice" <http://www.chez.com/scribe/wrote in message
news:AC**********************************@microsof t.com...
Hi, I answered in the vb group.

Please avoid multiposting (i.e. posting the same question in multiple
groups separately). Cross post (i.e. post the same question in multiple
groups at the same time so that this post is tracked accross groups) only
when really needed. In this particular case, ASP.NET doesn't have anything
to do in the problem....

--
Patrice

<ch***********@peninsula-uk.coma écrit dans le message de groupe de
discussion :
a7**********************************...oglegroups.com...
>I have some linqtosql

Dim col = (From cd In ctx.TBLContactData _
Join cc In ctx.TBLCompanyContacts On cc.CompanyContactID
Equals
cd.CompanyContactID _
Select test = cc.CompanyContactID).Skip(0).Take(10)
When I loop through the collection
For Each colobj In col
'I want be able to write col.test but this does work
It's important that I can reference cc.CompanyContactID as an alias.


Sep 17 '08 #3

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

Similar topics

11
by: Alexander Vasilevsky | last post by:
Linq "into" and "let" equally??? http://www.alvas.net - Audio tools for C# and VB.Net developers
4
by: BeSharp | last post by:
I recently stumbled across a pretty interesting LINQ to SQL question and wonder, whether anybody might have an answer. (I'm doing quite some increasing LINQ evangelism down here in Germany.). ...
1
by: john | last post by:
LINQ works a lot like an Access DB Recordset in the way it functions, one of the things I could do in Access is refer to the Fields thru a Variable as below allowing me to Iterate over the...
22
by: paululvinius | last post by:
Hi! Testing som Linq-expressions and tried to measure performance and compare it to pre-Linq programming. The folloing two methods are functional equal but the non-Linq one is twice as fast....
1
by: 0to60 | last post by:
Let's say we have your basic Invoices and InvoiceItems table. If we load this in with LINQ: var query = from i in db.Invoices select i; When I then loop through my invoices, if I wanna...
5
by: =?Utf-8?B?cmF1bGF2aQ==?= | last post by:
linq on objects... want to find if the object exist in its collection if I have a loop searching in the collection foreach (myClass r in collections) { if (r.field01 == type && r.field02...
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...
7
by: shapper | last post by:
Hello, Is it possible to multiply all Prices in a List<Productby 1.1 using Linq? Product has a property named Price. Thanks, Miguel
2
by: jelle79 | last post by:
Hi all, I'm storing all kind of data stored in objects. Now I want to query my data-source. And I thought LINQ is the right thing for it. Data is stored like: store.Database Queries like...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
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: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
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
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.