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.

InternalsVisibleTo, VB.Net, unittesting and windows forms components

I am not in the habbit of testing internal/friend methods, properties or anything else. Because I think testing public members should cover those. But sometimes you don’t really have a choice. In this case it’s the form designer that is the cause of my problems (not the first time) It by default creates controls and components as Friend which is fine by me since controls can be found via the ControlsCollection.

Read More...

Raising an event on a parametered event with Rhino mocks and returning null

Raising events on a mock is easy with Rhino mocks. I wrote a whole article about it. Way back then I wrote, If we try to use the same syntax on the parameterless event like so eventraiser.GetEventRaiser(e => e.event1 += null).Raise(null); we get an InvalidOperationException (You have called the event raiser with the wrong number of parameters. Expected 0 but was 0). Expected 0 but was 0 doesn’t sound completely right but I get the picture.

Read More...

Trying the Stand-Up Desk

This week was my first week trying the stand-up desk concept. While I had read of many people converting their office, I’m going to be reporting directly from the trenches, after spending a week in a cubicle with a stand-up desk and a list of architecture and development tasks that kept me tied to my desk, all day, every day. The Desk The last few months I have seen several posts about stand-up desks, with Ron Pereira showing his new setup, Kevin Mayer discussing accessorizing his work area, and Jon Miller taking the concept on the road.

Read More...

SQL Saturday in Chicago – Schedule is up!

Scheduled! The SQL Saturday in Chicago team has been working pretty hard lately on the schedule. It was difficult to complete due to all of the sessions being so good. I was close to trying a two day event so we could get all ~70 submissions up the weekend of April 17th. You can now see the schedule up on the SQL Saturday site here Of course we had to pick what the location we are using could handle and I think the team did an excellent job.

Read More...

Running sp_helpdb against a snapshot shows wrong files on SQL Server 2008

If you are using snapshots be aware that running sp_helpdb reports wrong files. Let’s take a look by running some code First create a test database use master go CREATE DATABASE [test] ON PRIMARY ( NAME = N'test', FILENAME = N'C:test.mdf' ) LOG ON ( NAME = N'test_log', FILENAME = N'C:test_log.LDF' ) GO Now let’s create a table and populate it with some data USE test go create table TestTable (id int not null,somecol char(100) default 'a') go insert TestTable(id) select row_number() over (order by s1.

Read More...

If you are suffering from Cisco VPN on 64 bit Windows then use the Shrew Soft VPN client

By now you probably have heard or seen the complains that there is no viable 64 bit VPN client that will work with a Cisco VPN. I myself either used a Virtual Machine (Virtual Box) or I have a dual boot system where I boot into the Fisher Price looking OS to VPN into work. Yesterday my suffering ended. I downloaded the Shrew Soft VPN Client For Windows and it has been working great.

Read More...

Visual Studio 2010 and .NET 4 release candidates available for download

Visual Studio 2010 and .NET 4 release candidates are available for download Right now the downloads are only available to MSDN subscribers. On Wednesday February 10th the downloads will also be available to the general public You can find the download links here: http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx

Read More...

Use Filters in SSMS to only see the things that are of interest to you

Now that all my server are SQL Server 2008 I use SSMS with SSMS Toolpack and Toad. I don’t really use Query Analyzer anymore. The other day I found out that you can hide objects you don’t want to see in SSMS by using filters. Let’s first look at some code. Create a new database named test, create a new schema named Denis and then add 3 tables to the dbo schema and 3 tables to the Denis schema.

Read More...

Interesting UNION with ORDER BY behavior

Here is something interesting to think about Create this table and insert these 2 rows create table TableName(id int, name varchar(50)) insert TableName values(1,'bla') insert TableName values(2,'bla2') Now if you try to do something like this SELECT TOP 1 ID,Name FROM TableName ORDER BY Name UNION ALL SELECT 0,'' You will get the following error **_Server: Msg 156, Level 15, State 1, Line 4 Incorrect syntax near the keyword ‘UNION’.

Read More...

ASP.NET MVC 2 (Release Candidate 2) Released

ASP.NET MVC 2 RC 2 has been released and is available for download. For those that don’t know what ASP.NET MVC 2 is. ASP.NET MVC 2 is a framework for developing highly testable and maintainable Web applications by leveraging the Model-View-Controller (MVC) pattern. The framework encourages developers to maintain a clear separation of concerns among the responsibilities of the application – the UI logic using the view, user-input handling using the controller, and the domain logic using the model.

Read More...