473,407 Members | 2,598 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,407 software developers and data experts.

Calling Andrus : LINQ-to-SQL id queries

A long time ago we discussed an issue with id-based queries in
LINQ-to-SQL; as an update, it is now suggested that this is fixed in 3.5
SP1.

Full info:
http://blogs.msdn.com/dinesh.kulkarn...nq-to-sql.aspx

Marc
Aug 18 '08 #1
12 1291
Well, part fixed ;-p

Single(pred) is fixed, but Where(pred).Single() still round-trips; for
example via Northwind see below.

Marc

using (NorthwindDataContext ctx = new NorthwindDataContext())
{
ctx.Log = Console.Out;
Console.WriteLine("Find first employee...");
var emp1 = ctx.Employees.First();
int id = emp1.EmployeeID;
Console.WriteLine("Where(pred)=>Single");
for (int i = 0; i < 10; i++)
{
var emp2 = ctx.Employees.Where(x =x.EmployeeID ==
id).Single();
}
Console.WriteLine("Single(pred)");
for (int i = 0; i < 10; i++)
{
var emp3 = ctx.Employees.Single(x =x.EmployeeID
== id);
}
Console.WriteLine("Exit");
}
Aug 18 '08 #2
Marc,
Well, part fixed ;-p

Single(pred) is fixed, but Where(pred).Single() still round-trips; for
example via Northwind see below.
Thank you.
I created code generator which creates code to implement cache using static
Dictionary<entityId,value properties for every property.
Every entity every property contains static getter method which performs
cache lookup first.
So I do'nt rely on DLinq cache.
The only way to use DLinq cache in winforms appl would be to use application
wide global DataContext class for retrieve and cache only.
However this is probably not reasonable since it does not allow to clear
cache partially.

Btw. Where find information about winforms changes ?
I have only found that there are number of new controls added, no more.

Andrus.

Aug 18 '08 #3
Btw. Where find information about winforms changes ?
I have only found that there are number of new controls added, no more.
Really? Which ones? I honestly don't expect any ground-breaking
winform developments - much of the thrust seems to be towards WPF and
Silverlight. I really must give them a good look at some point!

Marc
Aug 18 '08 #4
Really? Which ones? I honestly don't expect any ground-breaking
winform developments - much of the thrust seems to be towards WPF and
Silverlight. I really must give them a good look at some point!
Only info I have found is one sentence and picture from

http://weblogs.asp.net/scottgu/archi...ck-1-beta.aspx
SP1 adds several new Windows Forms controls - including new vector shape,
Printing, and DataRepeater controls:
Andrus.

Aug 19 '08 #5
Cheers - those had slipped past me; a shame about the namespace and the
non-core references it adds, but I assume that was chosen to retain
compatibility with where-ever it came from. I rather suspect the repeater is
the most useful...

Thanks,

Marc
Aug 19 '08 #6
Cheers - those had slipped past me; a shame about the namespace and the
non-core references it adds, but I assume that was chosen to retain
compatibility with where-ever it came from. I rather suspect the repeater
is the most useful...
I havent seen any new control in C# Express 2008 SP1 Toolbox.
There is no "Visual Basic PowerPacks" group in Toolbox.

How to use those control in C# Express ?

Andrus.

Aug 19 '08 #7
I would guess that you can simply reference it directly; for me that is in:

C:\Program Files\Common Files\Microsoft Shared\Visual Basic Power
Packs\1.1\Microsoft.VisualBasic.PowerPacks.Vs.dll

You would probably need to deploy this file to clients, too...

Marc
Aug 19 '08 #8
>I would guess that you can simply reference it directly; for me that is in:
>
C:\Program Files\Common Files\Microsoft Shared\Visual Basic Power
Packs\1.1\Microsoft.VisualBasic.PowerPacks.Vs.dll

You would probably need to deploy this file to clients, too...
I do'nt have "Visual Basic Power Packs" folder in "Microsoft Shared".
searching "Microsoft.VisualBasic.PowerPacks.Vs.dll" file in computer did not
return any results.
Andrus.

Aug 19 '08 #9
I do'nt have *"Visual Basic Power Packs" folder in "Microsoft Shared".
searching "Microsoft.VisualBasic.PowerPacks.Vs.dll" file in computer did not
return any results.
Are you using express? In which case I would have to conclude (without
any firm eveidence) that the dll is in VS2008 SP1, not .NET 3.5 SP1;
which probably also means you're not licenced for it without VS2008.

Marc
Aug 20 '08 #10
btw, MS have confirmed that they can reproduce the same LINQ issue as
above... we'll see whether it ever gets fixed ;-p
Marc
Aug 20 '08 #11
btw - have you installed express SP1?

Marc
Aug 20 '08 #12
Marc,
btw - have you installed express SP1?
I have installed C# Express 2008 SP1 and MSDN SP1 full library.

Maybe this assembly is part of VB 2008 Express SP1, havent tried.

Andrus.
Aug 20 '08 #13

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

Similar topics

2
by: Masoud Sharify | last post by:
does vc#2005 supports LINQ?(query in C# code)
3
by: jack | last post by:
Iv just heard of LINQ what is this all about
1
by: Chris | last post by:
I sort of asked this in my previous post but what is the status of linq? Is it in .net v3? Regards, Chris.
1
by: shapper | last post by:
Hello, I was using LINQ with VS 2008 Beta 2 and suddenly after installed VS2008 final version I get an error. My code is really simple: Dim database As New MyDbDataContext Dim tag = (From...
0
by: shapper | last post by:
Hello, I was using the following LINQ code in VS 2008 Beta 2: MyDbDataContext database = new CodeDataContext(); database.Tags.remove(tag); Now, with VS 2008 final release, I get an error on...
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....
0
by: Deepak.Verma3441 | last post by:
LINQ Book Introducing Microsoft LINQ http://jumbooks.com/books/Computers%20and%20Internet/Introducing%20Microsoft%20Linq/
6
by: hon123456 | last post by:
Why does the compiler say that 'Linq' does not exist in the 'System' namespace when specifying a using statement as follows: using System.Linq; ----
5
by: Neil | last post by:
Hi group, is there a special C# LINQ group available? Regards
23
by: Stewart Berman | last post by:
I am trying to develop a wrapper class for the Windows API functions in Visual Studio 2008: GetOpenFileName GetSaveFileName I put together a starter class: using System; using...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.