t-sql

Create a table that contains one one, two twos, three threes etc. upto a given maximum using t-SQl

DECLARE @max int
declare @val int
declare @inner int
set @val = 0
SET @max = 20

WHILE   @val<=@max BEGIN
	set @inner=0
		WHILE   @inner<@val BEGIN
				insert into @id(number) values (@val)
				set @inner= @inner+1
			END
		set @val = @val +1
	END

select * from @id
select count(*) from @id



Razor and c# etc.

Notes on my first stab at MVC on vs2010

@ are very important.

A good quick reference for those confused about the cshtml syntax:
http://haacked.com/archive/2011/01/06/razor-syntax-quick-reference.aspx/

Call a function from the page:

@( projectname.Controllers.SpecificController.FuntionName())

Basically fully qualify the name of the function and you should be fine.
You might have to declare the function as static.

http://www.w3schools.com/aspnet/showfile_c.asp?filename=try_webpages_cs_003

Help my VS2010 doesn’t work properly for the model section!!
“DBContext” Are you missing an assembly reference?

http://www.microsoft.com/en-gb/download/confirmation.aspx?id=1491 and include

using System.Data.Entity;

at the top of your source file/class whatever…