by brad
26. January 2010 11:15
FindControl() is great if you’re looking for a control one level down, but if you’re making a dynamic control with n levels of child controls it can become a pain… Extension Methods to the rescue! Not only does it find the control your looking for at any level in the page, it also used generics to return the control without needing to cast it. /// <summary>/// Finds the control (Recursively) with an ID matching that given, of the Type requested. /// No need to cast either!/// </summary>/// <typeparam name="T">The type of control to return</typeparam>///...
[More]
by Dominic Zukiewicz
31. March 2008 15:33
Updated: This article is 2 of the 2 posts about this problem (Problem AND Solution)
The answer to this is definitely ... NO!
When a colleague looked over my example, we shared some ideas about what LINQ is actually doing.
It turns out that my LINQ version was working faster because it wasn't actually doing anything!
By design, LINQ defers all processing until the data is actually used. Being assigned as it was wasn't enough!
var q = from c in db.Customers
where c.City == "London"
select c;
This only prepares the query, but no executi...
[More]
ab493d5c-af3f-468c-bdfa-02d2a510e81e|0|.0
Tags:
.NET 3.5
by Dominic Zukiewicz
24. March 2008 19:10
Updated: This article is 1 of the 2 posts about this problem (Problem AND Solution)
Today, I looked into using LINQ and SQL together. I read about the CompiledQuery.Compile() method which can speed up queries because of the caching. So I decided to run the queries one by one and view the performance improvement.
Unfortuantely, I witnessed that the Compiled version took over 20 times longer to run than the non-compiled. I will ask my Microsoft contacts to clarify this, but in the meantime, if you know why this is, please let me know.
Pre-requisites
Visual Studio 2008
Add a...
[More]
806eef21-1bc7-49e9-b0df-d9db9b04c02c|0|.0
Tags:
.NET 3.5