MVC: First Look

by Steve Ciske 11. December 2008 08:13

 

I've had a chance recently to do some development work using Microsoft's MVC.  The first thing that I'm impressed with the the hackable URLs.  I wrote my own some time back using asp.net 2.0 and I have to tell you.  That was not fun.  MVC makes this as easy as 1-2-3.  The second thing that I'm impressed with is the model/controller.  It's easy to setup new pages and defaults.  I started working on Forms/Data last night and ran into a few snags but I managed to hack through it.  I think they still have some work to do in this area, but it's still usable.  I'll keep posting more on this topic as I dive deeper.

Categories:

SQL Server and CLR Assemblies C# - 6 Steps

by Steve Ciske 28. August 2007 12:39

I had a chance to play around with this new feature in SQL 2005 the other day.  After reading a few articles here is the quick and dirty on how to implement.

A quick and dirty guide as to when is the best time to use:

http://www.developer.com/net/net/article.php/3528601

 How to add:

1) Create a Class project in Visual Studio

2) Create a new class and cut and paste the following code:

using System;
using System.Collections.Generic;
using System.Text;

namespace SampleCLR
{
    public class CLRTestClass
    {

        public static string Freak(string name)
        {
            return name.ToString() + " Is a FREAK!!!";

        }
    }
}

 

3) Compile.

4) Next

Register the assembly (in SQL 2005) by right clicking ‘Assemblies’ > ‘New Assembly’ under Programmability.

5) Run these scripts:

  SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE FUNCTION dbo.clrWhosFreak(  @name as nvarchar(200) ) RETURNS nvarchar(4000)  AS EXTERNAL NAME [SampleCLR].[SampleCLR.CLRTestClass].[Freak]  

sp_configure 'clr enabled', 1

go

reconfigure

go   

6) Then open a query window and run….  

select dbo.clrWhosFreak('Steve')

 

Categories: