Posts

Showing posts from May, 2009

ASP .Net server control for youtube embeded videos

Here is ASP .Net server control for youtube embeded videos.
The param definitions can be found here
Only Src param is required, other parameters are generated only if have another value than the default one.
Usage

<cc1:YouTubeEmbed ID="YouTubeEmbed1" runat="server" Src="http://www.youtube.com/v/P38oxTrWYp0&f=videos&c=ytapi-AdrianIftode-youtubelyricsmas-ia9d2g0e-0"
AutoPlay="false"
AllowFullScreen="false"
Border="true"
PrimaryBorderColor="0x6b8ab6"
SecondayBorderColor="0x2b405b"
GenieMenu="true"
HighDefinitionPlayback="false"
LoadRelatedVideos="false"
Loop="false"
ShowAnnotations="true"
ShowClosedAnnotations="true"
ShowInfo="false"

Think LINQ deffered execution like an non-clustered SQL View

LINQ deferred execution is when you create the query, but this is not executed until you need it. So first you tell what you need and you'll get it when is needed by calling methods like ToList, First, Single, etc.


var ctx = ...
var query = from p in ctx.products
where p.enabled == true && c.deleted == false
select p;

After calling query.ToList(), the LINQ creates the SQL, sends it to server, get the results and then creates the products list. query is an IQueryable<T> object and ToList creates an IList<T> object.

An non-clustered SQL View acts pretty same like the LINQ non deferred execution. First you define the query, then you call it or use it in any other queries.

CREATE VIEW vwProducts
AS
SELECT p.*
FROM dbo.products p
WHERE p.enabled = 1 AND p.deleted = 0

SELECT *
FROM vwProducts p
WHERE p.description like '%potatoes%'

SQL Server will expand the View vwProducts when the last query is executed.

So, how to see the first LINQ query like a v…