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

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

LINQ to SQL very slow website

Posted By:      Posted Date: October 09, 2010    Points: 0   Category :ASP.Net

I have created a website with asp.net 3.5 and c# (using linq to sql).  its a basically a project managment system. bt its very slow when u look at its loading time. my dashboard takes a whole lot of time to load. i was wondering if anyone can guide me in increasing my site's loading time.

when i look at other sites created by my colleagues it loads much faster than my site. they have developed it using ado.net + Stored procedures. that made me believe that linq to sql is slower than ado.net + SP combination.

any suggestion to improve my site perfomance using linq to sql will be appreaciated.

View Complete Post

More Related Resource Links

Live website slow - very urgent


Hi All, 

Finally i came to know because of firebug that  ScriptResource.axd's (multiple) are making my files slow on first click

How do i merge them into 1 ??



1. ScriptResource.axd is making my page slow in first click.

On second click onwards its fine as i have added handler from http://madskristensen.net/post/Compress-WebResourceaxd-in-ASPNET.aspx   It helps performance but from second click onwards.I am testing it with FireBug.

2. I have also seen and treid http://www.codeproject.com/KB/aspnet/AspNetOptimizer.aspx  but not able to make out how to implement in my application.

3. I also tried http://madskristensen.net/post/Optimize-WebResourceaxd-and-ScriptResourceaxd.aspx but it has error, I tried making chnage as per the discussion in url but it is sill giving error.

4. I have also made scriptmanager as release mode

Please help its urgent


Playing with Linq grouping: GroupByMany?

One of its features is grouping. Many people understand grouping like it is defined in Sql. Linq is implementing grouping quite the same way. Let's discover this syntax and how to make consecutive groups easier.

LINQ : Implementing IN and NOT IN

I got tried of typing

var result = from s in source
where items.Contains(s)
select s;and so I implemented the IN and NOT IN methods as extension methods:

101 LINQ Samples Tutorials

101 LINQ Example with sample code snippets....This sample prints each element of an input integer array whose value is less than 5. The sample uses a query expression to create a new sequence of integers and then iterates over each element in the sequence, printing its value

Linq: how to share parameters between lambda expressions ?

When using Linq to objects, you will quickly feel the need to pass some parameters from a method to another but it's not so easy because each Linq method is not calling the following one. In a Linq sequence, each method is using the result computed by the previous one. So, local contexts are not visible from one method to another.
The compiler is using two technical different ways to let parameters go out of a method.

Linq to Sql CompiledQuery container

Ok now let's go. Here is just a little trick but with some interesting patterns that could be useful in some other contexts not connected to Linq to Sql.

When using Linq expressions, like with Linq to Sql, translating the expression into something else (sql for example) is taking time and resources. Sometimes it's negligible, sometimes not...

LINQ to SQL Paging using GridView in C# and ASP.NET 3.5

This tutorial will show you how we can extend the LINQ to SQL Class and create methods that will allow us to page data from a SQL database. C# version.

What is Lambda Expressions In LINQ

A lambda expression is an anonymous function that can contain expressions and statements, and can be used to create delegates or expression tree types.

All lambda expressions use the lambda operator =>, which is read as "goes to". The left side of the lambda operator specifies the input parameters (if any) and the right side holds the expression or statement block. The lambda expression x => x * x is read "x goes to x times x." This expression can be assigned to a delegate type as follows:

How to create 3 tier application using LINQ

As you know that in 3 tier architecture there are three layers

User interface layer. (Is our Form in Windows application and .aspx page in Web application)
Data Access layer. (Which provides interface between Business logic layer and Database)
Business Logic layer.(Which stores your application logic)

Building a LINQ Provider

Throughout this article, we will build a simple IQueryable provider similar to the LINQ to SQL provider demonstrating what is needed to build a custom provider that is capable of executing LINQ queries and performing create, update and delete operations.

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.

Resources for soup-to-nuts of website development lifecycle



 I'm looking for a website, or book, or some resource that can lead me down the path from website design to implementation/deployment. I know that covers a ton of material, but I am really looking for the bullet points, or high-lights, to make sure that I think of everything. I am mostly fuzzy on security measures and deployment since I haven't been involved in those aspects before.

Background:  I have been a programmer for many years, and with a little over 3 years' experience coding websites in vb.net/asp.net with sql server. Due to recent restructuring/layoffs at our firm, I find myself in the position of lead IT person - I'm feeling a bit underqualified but I feel this is my chance to work hard and step up to it. I'm very good at vb.net, master pages, css, asp.net, sql server. I'm worried that the person who was the lead before was doing a bunch of stuff that I'm not aware of...so I need to start learning more than just the code. I don't need lessons on how to code anything...I need to learn how it all gets put together - the next step up.

thanks for any suggestions!

Response.Redirect slow


I'm in the middle of migrating servers and on the new server Response.Redirect is extremely slow. It takes around 20 seconds for the browser to get the redirect. This is something that was quick on the existing server. It's an ASP.NET 2.0 application, both servers are running IIS6.

Additionally, if I "manually" do the redirect, it's fast. For example:

Existing way:


takes around 20 seconds on the new server

New way:

Response.Status = "302 Moved Temporarily";
Response.AddHeader("Location", url);

is fast on the new server.

Any ideas why Response.Redirect would be so slow on the new server?

website load testing


How can i check "load testing" on my site (its using vb.net and SQL server)? Any free tool available or can it be done through windows server IIS?

Difference Btw Website vs Web application and Virtual directory in IIS 7


May i know what is the Differenc that they actually make in IIS7 .

Please tell me at a low level as i am still a novice in Asp.Net


Thanks in Advance.


Passing Linq Statement between master and content page


I usually work with windows forms, and am just starting to work with ASP.Net, so appologies if this is a dumb question!

I have a master page which has a search button on it. The results of this are built up using a Linq statement and if there are any results, I want to display the results in a contents page.

On the masterpage, I have the following code:

Private _res

    Public Overridable ReadOnly Property SearchRes()
            Return _res
        End Get
    End Property

 Private Sub DoSearch()
   'some code to get a linq result

    If res.Any Then
            _res = res
            Server.Transfer("SearchResults.aspx", True)
            'no results
            LabelNoRes.Visible = True
        End If
 End Sub

On the SearchResults.aspx page I have this code.

Dim m As pxSite = CType(Page.Master, MasterPage)
        If m.SearchRes IsNot Nothing Then
            Label1.Text = "Results found = " & m.SearchRes.Count
        End If

m.searchRes is always nothing. 

What am I doing wrong here?


Why isn't my Views/Home/Home.Master file published when I publish my website?


Hi All,

I spent the better part of today hunting down an elusive error.  I was getting a message saying that it couldn't find the Index view for the Home controller, and it gave a list of locations it searched, e.g., ~/Views/Home/Index.aspx.  This was really confusing as the file definitely existing and was at ~/Views/Home/Index.aspx, the first place in the list of locations it searched for the view!

What I eventually discovered was that there was a file that did not get published when I used Visual Studio's "Publish" feature (this is on the "Build" menu).  That file was Views/Home/Home.master, and (as you can probably guess) is the master file used by Views/Home/Index.aspx.

Once I copied that file into place manually, it started working.  But I am left wondering--why???  Why does this file not get published?  It's a part of my project, I can see it in the solution explorer, and it's obviously a critical file that's necessary for the MVC app to run.  It has the same permissions as every other file in my project.  So why wouldn't it get copied?  And how can I fix it so it does get copied?

Thanks for any suggestions on this!


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