Investigation of CSLA 2

I am investigating the use of CSLA 2.

How complex is this to use out of the box and can it be combined with the Castle Project?

So far I have downloaded the source from. The source supplied builds as is.

I only have the CSLA 1 book and am trying to see if I can get CSLA 2 to work using just that.

First step is to use VS.NET to create a database and add some tables.

VS 2005 Rant 

The VS.NET IDE allows the creation of a database and adding tables.

It will refuse to rename rows and can only change datatypes according to the underlying db rules (why can’t it remove and reinsert a column?)

 I am now entering the stored procedures for the Product Tracker application.

They seem to be very simplistic with no error handling or auditing (but this is a demo application).

The joins are not very explict sometimes being of the form SELECT A, B FROM FOO, BAR WHERE …

I can see why Kathleen Dollard decided to use this as a basis for her code generation tools.

These are intrisically generatable stored procedures – compare to those that I have been used to with integrated error handling anf auditing. 

MS finally get TDD

Microsoft have finally learnt about TDD.

A year or so ago they had an article trying to claim a process of TDD that invloved generating the tests from the code.

They rapidly pulled the article as it clearly showed that they did not get the idea at all. 

The problem with their suggestion is that it involves Visual Studio Team System which is a bit of a sledgehammer compared to say NUnit and CruiseControl.NET which are far more mature products.

 

Make cassini work with .net 2

Recently I have been playing with Monorail the port of Ruby on Rails to C#/.NET
I needed to get Cassini to work with .NET 2

The initial version of Cassini that I have was built against  

I added the following as CassiniWebServer.exe.config 

<?xml version =”1.0″?>
<configuration>
<startup>
<requiredRuntime version=”v2.0.50727″/>
<supportedRuntime version=”v2.0.50727″/>
</startup>
</configuration>

This is all that was required. 

Paging in sql server

This may not be the most elegant paging code for sql server but it solves the problem:

create database foobar
go

use foobar
go

drop table test
go
create table test(id int not null, name varchar(10) not null, primary key(id))
go

insert into test values (1,’one’)
insert into test values (2,’two’)
insert into test values (3,’three’)
insert into test values (4,’four’)
insert into test values (5,’five’)
go

select top 2 *
from test  
where id not in (select top 2 id from test)
order by id
go