.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Basic Instincts: Increase LINQ Query Performance

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

Jared Parsons demonstrates a technique to achieve maximum performance from LINQ queries on large sets of data in order to create a responsive user interface.

Jared Parsons

MSDN Magazine August 2008

View Complete Post

More Related Resource Links

Basic Instincts: Query Comprehensions


Scott Wisniewski digs into LINQ and builds a custom query provider to create queries in real-world apps.

Scott Wisniewski

MSDN Magazine August 2007

Help on basic Linq query

i have this model of my payroll systembut i can't query from my employee, i mean can't fetch the data in employee so that i can manipulate the data to compute the payroll Employee employee = new Employee();           var query = from s in employee  where employee.EmployeeId == payslip.Employee.EmployeeId select employee.Rate;           decimal rate = query.FirstOrDefault(); Employee employee = new Employee();PaySlip payslip = new Payslip()Uploaded with ImageShack.us          var query = from s in employee  where employee.EmployeeId == 1 select employee.Rate;          decimal rate = query.FirstOrDefault();but i get this error could not find an implementation of the query pattern for source type 'PayrollSystem.Models.Employee' 'Where' not found.when i research other references their code always has this DataContext db = new DataContext(); i do not know how to declare datacontext help anyone?

LINQ to SQL Performance Considerations

As developers we have a wide array of tools at our disposal. One of the most time consuming, but most beneficial tasks we must undertake is to determine which of those tools to use for a given situation.

Linq qry with order by basic questions


I have never tried a group by with linq, now I do and I'm stuck.

I try to convert this sql statement to its linq counterpart :

SELECT COUNT(tb_Mailer_Smses.Id) AS [cnt], tb_Mailer_mailing.Id As [Id]
,SUM( CASE WHEN tb_Mailer_smses.DLRStatus = 200 THEN 1 ELSE 0 END) As [Delivered]
FROM tb_Mailer_mailing INNER JOIN
tb_Mailer_Smses ON tb_Mailer_mailing.Id = tb_Mailer_Smses.MailingId
WHERE tb_Mailer_mailing.ApplicationId = 1
GROUP BY tb_Mailer_mailing.Id

Is there some one who can me show me the convertion process ?

Need help with a linq to sql query


I want to display some stats in a listview contril.  The table contains a record for every impression and for every click, and every record has a datetime field for the time and date of the impression of click.  I want to be able to display how many impressions and clicks there were in a given day and hour, something like below:

Date              Time                              Impressions    Clicks
8/20/2010                                               450              14            
                     Midnight -1:00am               150               5

how to increase Performance onloading page and navigation of records ?? Help








this is my aspx and cs code , let me know whether it is correct or not??

onload and performance on navigation of record show be good.

Plz help me

<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="True"

                DisplayGroupTree="False" ReuseParameterValuesOnRefresh="true" HasToggleGroupTreeButton="False" Height="1039px" ReportSourceID="CrystalReportSource1"

                Width="901px" />

            <CR:CrystalReportSource ID="CrystalReportSource1" runat="

Need Help in LINQ query for group By with chunks of record


I am assigning and unique id [strShipperIdSequence] on my List on bases of some properties which are grouped together uniquely.
Now what i needed is that my group should be further break down to some maximum amount of chunks.[Let say 10]
that mean's even i am having Same value in 12 records i should get 2 groups[I of 10 items and other of 2 items]

var uniqueGroups = objMdbContentInfoList.GroupBy(p => new
}).Select(g => g.First()).ToList();
foreach (var objUnique in uniqueGroups)
string strShipperIdSequence = APIGlobalMethods.GetShipperRequestID();
foreach (MdbContentInfo obj in objMdbContentInfoList.FindAll(h => (h.CON_ENTRY_POINT == objUnique.CON_ENTRY_POINT &&
h.APPTType == objUnique.APPTType &&

Query an arraylist of array list using linq


I have an array list called Customer. I t holds a list of array list which has the account details.

proj.customer -> collection of arraylist of type customer

proj.customer.account -> collection of arraylist of type account

Account array list holds type account and it has a poperty account balance. How can I query all accounts which has account balance  >100

I tried the following one

var Accountlist= from Account accountdetails in proj.customer.account

where accountid.balance >100

select accountdetails.id

But it is always throwing an error saying cannot cast type customer to type account

Please help

Basic Instincts: Multi-Targeting Visual Basic Applications in Visual Studio 2010


Visual Studio 2010 lets you create applications that target versions of the Microsoft .NET Framework from 2.0 to 4, and each step in between. We take a look at how multi-targeting works in Visual Studio today, and explain how you should approach multi-targeting in your projects.

Spotty Bowles

MSDN Magazine June 2010

Basic Instincts: Generic Co- and Contravariance in Visual Basic 2010


Dig into the new co- and contravariance features coming in Visual Studio 2010. Binyam Kelile provides hands-on Visual Basic examples to explain how they provide more flexibility when working with generic interfaces and delegates.

Binyam Kelile

MSDN Magazine March 2010

Basic Instincts: Collection and Array Initializers In Visual Basic 2010


Collection Initializers are a great addition to the language and allows concise syntax in order to initialize both framework and user defined collection types.

Spotty Bowles

MSDN Magazine October 2009

Basic Instincts: Stay Error Free With Error Corrections


Error corrections are an essential part of the Visual Basic coding experience. This article explores the many error correction features offered by Visual Basic and provides a glimpse at the future release of Visual Studio 2010.

Dustin Campbell

MSDN Magazine July 2009

Basic Instincts: Documenting Your Code With XML Comments


XML comments provide an easy and effective way to document your code. We'll show you how to use and customize XML comments in your Visual Basic projects.

Lisa Feigenbaum

MSDN Magazine May 2009

Basic Instincts: Inspecting COM Objects With Reflection


Reflection is useful for debugging and logging and otherwise providing the type information you need. Here you'll see how to use reflection on COM types.

Lucian Wischik

MSDN Magazine January 2009

Basic Instincts: Dynamic Data Entry With XML Literals


Learn how to use Windows Presentation Foundation (WPF), XAML, and the deep XML support in Visual Basic to generate user interfaces dynamically.

Beth Massi

MSDN Magazine October 2008

Basic Instincts: My Namespace Extensions with My Extensibility


In this month's column, learn how to integrate your own My Namespace extension into the Visual Basic development environment using the My Extensibility feature.

Matthew DeVore

MSDN Magazine April 2008

Data Points: Standard Query Operators with LINQ


LINQ to Objects and LINQ to Entities have an arsenal of Standard Query Operators that operate on sequences to perform a wide variety of operations.

John Papa

MSDN Magazine March 2008

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend