CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > visual_studio.visual_studio_2008 Tags:
Item Type: NewsGroup Date Entered: 1/4/2008 10:48:13 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 1 Views: 97 Favorited: 0 Favorite
2 Items, 1 Pages 1 |< << Go >> >|
John Hoge
Asp.Net User
How to do "Select top 1 customer from customers" in Linq to Sql?1/4/2008 10:48:13 PM

0

I've gotten half way there:

 var customerList = from c in dc.Customers orderBy c.Sales select c;

 That gets me a collection of customers. How do I use the equivalent of the top operator in SQL?

Thanks,

John
 

Jeev
Asp.Net User
Re: How to do "Select top 1 customer from customers" in Linq to Sql?1/4/2008 10:56:42 PM

0

var customerList = (from c in dc.Customers orderBy c.Sales select c).Take(1);


Jeev
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you get the answer to your question, please mark it as the answer.
2 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Accelerated SQL Server 2008 Authors: Robert E. Walters, Michael Coles, Robert Rae, Fabio Claudio Ferracchiati, Robin Dewson, Donald Farmer, Pages: 816, Published: 2008
Pro LINQ: Language Integrated Query in C# 2008 Authors: Jr. Rattz Joseph C., Joseph C. Rattz, Pages: 600, Published: 2007
Professional C# 2008 Authors: Christian Nagel, Bill Evjen, Jay Glynn, Karli Watson, Morgan Skinner, Pages: 1782, Published: 2008
MASTERING MICROSOFT VISUAL BASIC 2008 Authors: Evangelos Petroutsos, Pages: 1152, Published: 2008
Pro ASP.NET 3.5 in C# 2008 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1498, Published: 2007

Web:
How to do "Select top 1 customer from customers" in Linq to Sql ... Sales select c;. That gets me a collection of customers. How do I use the equivalent of the top operator in SQL? Thanks, ...
Linq to SQL - Select top 1... - ASP.NET Forums How do i write a SQL query like this in Linq? SELECT TOP 1 * FROM table ORDER BY col DESC. Best Regards, Christian Jørgensen, Denmark ...
How to do "Select top 1 customer from customers" in Linq to Sql ... How to do "Select top 1 customer from customers" in Linq to Sql? - ASP.NET Forums. var customerList = (from c in dc.Customers orderBy c.Sales select c). ...
SCIP.be - Articles : .NET - LINQ to SQL - part 1 Aug 30, 2007 ... [CompanyName] FROM ( SELECT TOP 1 [t6].[ProductID] FROM [dbo]. ... Customers. Single(c => c.CustomerID == customerId); return customer; .... When consuming a query which uses 'new' to do some data shaping with non-mapped ...
Chris Sainty: LINQ-to-SQL: Insert/Update/Delete This code generates and executes the following SQL. SELECT TOP (1) [t0]. .... Customers select cust).FirstOrDefault(); Console.WriteLine(c. .... which is required to do some operations with that object later on, such as DeleteOnSubmit () ...

How to do "Select top 1 customer from customers" in Linq to Sql ... How to do "Select top 1 customer from customers" in Linq to Sql?, > ROOT > NEWSGROUP > Asp.Net Forum > visual_studio.visual_studio_2008, ...
LINQ Trouble - ng.asp-net-forum.visual_web_developer_2008_express How to do "Select top 1 customer from customers" in Linq to Sql ... Pro LINQ: Language Integrated Query in C# 2008 Authors: Joseph C. Rattz, ...
Solution File Madness, Getting error saying: "The Project file ... How to do "Select top 1 customer from customers" in Linq to Sql ... solution file madness, getting error saying: "the project file '' has ...
Unit Test Adapter threw exception - ng.asp-net-forum ... How to do "Select top 1 customer from customers" in Linq to Sql ... unit test adapter threw exception · ajax pages developed in vs 2005 ...
Split View - Page contains markup that is not valid when attached ... how to do "select top 1 customer from customers" in linq to sql? layout menu - absolute and relative position · installing visual studio 2005 after a 2008 ...






website from 2005 to web application in 2008

.js files

beginner: creating a asp.net report page?

ide smart code analyzer stopped working after vs2008 installation

design view locks up

namespaces "sys.preview" and "sys.preview.data" still exist in vs 2008

compiling error in vs2008 on vista ultimate, related to web.config

extend linq to handle mundane business logic

visual web developer 2008 didnt install well....and i cant fix it!

avoid have x no. of developer server start up at debug

website is not recognized as an asp.net 2.0 website in vs2009 and vs2005

can't reference new controls by id

using the built-in webserver for development.

ajax extensions scriptmanager missing

error when compiling web service that was upgraded from 2.0 to 3.5

vs2008 final release - visual studio conversion wizard error - comexception

visual studio 2008 web access method

comexception opening asp.net web application

uninstall vs2008-how to ?????

can't debug my asp.net project

unable to attach to the process.

can't find wsdl.exe or command prompt in vs2008 team edition

source control & auto check out

javascript intellisense - type definitions

error after targeting .net framework 3.5: child nodes not allowed

installation worries!! please advise!

vwd 2008 express. can't create websites.

"the operation could not be completed. invalid formatetc structure".

unable to view asp.net web site and asp.net web serivce template

performance issues with vs2008 even after hotfix (kb946581) installed

   
  Privacy | Contact Us
All Times Are GMT