I sorted it...
Dim devServer As Boolean
Try
Dim config As System.Collections.Specialized.NameValueCollection = CType(System.Configuration.ConfigurationSettings.GetConfig("sqlServerCatalogNameOverwrites"), System.Collections.Specialized.NameValueCollection)
Dim x As String = config("NorthwindTest1")
If x = "Northwind1" Then
devServer = False
Else
devServer = True
End If
Catch ex As Exception
devServer = True
End Try
This assumes that your code is generated for NorthwindTest1 and you can either remove the sqlServerCatalogNameOverwrites section altogether or comment out the key and it should detect it.
There's probably a much simpler way of detecting the catalog name at run time, if you know it, please provide it below as my way is bound to have several holes in it!