LessThanDot Site Logo

LessThanDot

A decade of helpful technical content

This is an archive of the posts published to LessThanDot from 2008 to 2018, over a decade of useful content. While we're no longer adding new content, we still receive a lot of visitors and wanted to make sure the content didn't disappear forever.

Rhino mocks and raising an event that has parameters and the AAA syntax

Testing things with Rhino mocks and the AAA syntax is simple. But sometimes I need a reminder of the correct syntax. And sometimes the result is not what I would expect. But then that’s what my users say about my programs too ;-). I wrote a little testcase to see if I could reproduce the same result. And like I said before Rhino moccks’ AAA syntax is much easier to use in C# but I will make a VB.

Read More...

StructureMap is way cool even in VB.Net

In my previous post I already mentioned the BuildUp method in StructureMap and how cool that can be. And now I want to show you how to do this in VB.Net. As we all know VB.Net doesn’t like Multiline lambdas or void lambdas. But we will kill somebody for that later. In this example I also used a real form and it didn’t get hurt by the designer this time.

Read More...

StructureMap is way cool.

And it just got cooler. After I read this “BuildUp” Existing Objects with StructureMap I got an aha moment. The BuildUp function that was recently added just solved my very ugle winforms usercontrol problem. I use to have to add objectfactory.getinstance code in the constructors to get my dependencies just to keep the designer happy. I hate to design winforms without the designer but the designer hates me. But now this love hate relationship has bcome a little more livable.

Read More...

How to implement a typeof operator in SQL by using sql_variant_property

I posted a puzzle here Prove that this is an integer asking people to prove that the following code is indeed an int DECLARE @d INT SELECT @d = 500 or this the number 5 itself, how do you know that this is an integer? Well this is pretty easy, you can sql_variant_property with the BaseType property. Run this code IF cast(sql_variant_property(@d,'BaseType') as varchar(20)) = 'int' PRINT 'yes' ELSE PRINT 'no' As you can see yes is printed, the code below will return int for the number 5

Read More...

SQL Friday, The Best SQL Server Links Of The Past Week Episode 7

Here we are with another super exciting episode of the SQL Friday, The Best SQL Server Links Of The Past Week show Here is what I found interesting this past week in SQL Land: SQL Server Spatial: EMPTY vs. NULL Yesterday a friend asked me if it was better to always use a value of GEOMETRYCOLLECTION EMPTY as an alternative to making a geometry/geography column nullable. OGC has its own concept of database NULL, that is [GEOMETRY] EMPTY, where [GEOMETRY] can be any valid geometry subtype (that is ‘POINT EMPTY’, ‘LINESTRING EMPTY’, etc).

Read More...

Return all the columns in the database which allow NULLS

This question popped up on the MSDN forum today: Status of BIT type columns Here is a way to quickly find all the columns in your database which allow NULLS select table_name,column_name from information_schema.columns where is_nullable ='YES' order by table_name,column_name Now you might have noticed that some of these are views. You can join with information_schema.tables and filter on table_type = ‘base table’ to list just the tables. select c.

Read More...

The internet is scary

Today I recieved this email from Wikipedia. **Someone from the IP address 213.249.29.28 requested that we send you a new login password for the English Wikipedia. The new password for the user account “myusername” is “theusername”. You can now log in to Wikipedia using that password. If someone else made this request, or if you have remembered your password and you no longer wish to change it, you may safely ignore this message.

Read More...

automapping fluent nhibernate and VB.Net

I thought it was time to use fluent nhibernate just to keep up. Up untill now I still use the old atributes and nhibernate 1.2.1 because I see no reason to upgrade. It all just works and does what it is supposed to do. But I don’t want to stand in the way of progress and I want to help the VB.Net community ahead. So that Jeremy can feel a bit better about the VB.

Read More...

B2evo and the tagcloud

We here at LessThanDot use b2evo as our blogengine for several reasons. 1) It’s written in php and therefor fits well with the other parts of the site. 2) It’s free. 3) It’s open source. 4) It’s free. 5) It supports multiple authors. 6) It supports cattegories. The categories were very important because we wanted to create the same structure on the blog that we had on the forums. We started of with the idea of creating a technical forum.

Read More...

SQL server Linked server between 2005 64bits and a 2000 32 bits server.

Today I wanted to import the last bits of data from the old server. The new server is a 2005 64 bits SQL server and the old server is a 2000 32 bits. I’m no DBA and everything is internal so I don’t really care about service packs and I can’t remember which has which allthough I’m sure the 2000 box has the latest SP but since they aren’t even connected to the internet updating isn’t easy.

Read More...