Posts in category microsoft - page 5

Joining the LINQ to SQL team at Microsoft

I’ve been quiet on my blog lately largely because I have been preparing to change job and relocate half-way around the world to Vancouver in the beautiful province of British Columbia (where I spent my 2004 summer holiday).

In February I traveled out to Redmond for three days of interviews (one position grew to two, then three). Having read the Microsoft Jobs Blog I was prepared for long hard days but in reality the process was incredibly enjoyable and exciting.

So much so I wanted to find a desk and move in right then.

With some luck I also found myself at Hanselman’s geek dinner which involved some great discussions and the chance to meet Scott himself, Brad Wilson and Nikhil Kothari who I knew from .NET on-line community as well as some ~35 other developers from both within Microsoft and the outside world. It was one fun evening and my thanks go to Scott for kindly driving me back to my hotel in Redmond town center.

Many white-boards and a few lunches later (including an unexpected one with Phil Haack, Nikhil and two more guys from ASP.NET team – I wish I could remember all the names of the people I met!) I found myself with the hard task of choosing a position.

I settled on a developer role within the LINQ to SQL team starting mid-May and am counting down the days…


Visual Studio, Windows Server and SQL Server 2008 launch in Guernsey

The various Heroes Happen Here community events in the UK/USA to celebrate the launch of Visual Studio 2008 etc. made me envious that we don’t get such events and goodies here on the little island of Guernsey so I thought I’d so something about it!

We at the Guernsey Software Developer Forum are hosting a community event in conjunction with Microsoft to celebrate the launch of Visual Studio 2008, Windows Server 2008 and SQL Server 2008.

The event starts at 6:30pm on March 27th (next Thursday) at La Rocquettes hotel in St. Peter Port, Guernsey.

We will be giving away a bunch of goodies including the Heroes Happen Here launch packs with promotional copies of Visual Studio 2008 Standard, Windows 2008 Enterprise Server and SQL Server 2008 Developer as well as demonstrating some of the new features of Visual Studio 2008 and .NET 3.5.

I’m hoping this event will be bigger than normal GSDF events given the cool stuff we are giving away and the interest from non-developers in Windows 2008 and SQL Server 2008 so tell your friends (if you’re in Guernsey of course)


DLookup for Excel

I had to do a couple of ad-hoc Excel jobs today and found that whilst Excel has a VLookup function for spreadsheet/ranges it doesn’t have one for databases.

It’s been a while since I touched VBA and Access but the DLookup function was quite useful so here it is for Excel. Read the warnings below before you use it!

Public Function DLookup(expression As String, domain As String, criteria As String, Optional connectionString As String)

    Dim con As ADODB.connection
    Set con = New ADODB.connection
    If IsMissing(connectionString) Then
        con.Open "Driver={SQL Server};Server=abc;Database=def;Trusted_Connection=Yes;"
        con.Open connectionString
    End If

    Dim rs As ADODB.Recordset
    Dim sql As String
    sql = "SELECT TOP 1 " + expression + " FROM " + domain + " WHERE " + criteria
    Set rs = con.Execute(sql)
    If Not rs.EOF Then DLookup = rs(0)
    Set rs = Nothing

    Set con = Nothing

End Function

Copy and paste the code above into an Excel module and replace the “Driver=… with what you want to be your default connection.

Some examples of use:

To select the Name column from the Customers table where the numeric ID is held in column 2.

=DLookup("Name","Customers","ID=" & A2)

To return Forename and Surname columns joined together with a space from the Contacts table in the crm database using the postcode from column 5

=DLookup("Forname + ' ' + Surname","crm..Contact","PostCode='" & A5 & "'")

To return Description from a Products table held in another connection using a partial like match from column 1:

=DLookup("Description","Products","OrderCode LIKE '" & A1 & "%'", "DSN=SecondaryDSN")

I think you get the idea!

There are a few caveats you need to be aware of using this function:</p>
  • It only returns the first value of the first row
  • DLookup’s are not efficient opening a connection each time it is referenced. This could put a lot of strain on your server.
  • DLookup syntax is open-ended and has some attack vectors.

If that doesn’t scare you then give it a shot. As usual no warranty expressed or implied!


Microsoft opens Office binary file format specifications

Microsoft have released the binary file format specifications to their Office suite (the XML ones are already published) under their Open Specification Promise.

I am not a lawyer but as far as I understand this means you are free to implement the standards with a promise that Microsoft will not use any patents under its control that are required to implement the specification against you.

Hopefully Apple will now address Keynote’s PowerPoint support bug so exported PPT’s works with Office 2007.

Now that the .NET Framework 3.5 source is available (for reference) and Scott Guthrie (now VP) announcing the MVC framework will be user-buildable and patchable (not re-distributable) and include project templates for a number of open-source testing frameworks the future is looking very rosy.