Home
March 6th, 2010 — James

Here is a slightly dark color setting that can be imported to Visual Studio 2010.

Color setting for XML.

Color setting for HTML

Color setting for C#

CSS coloring

Download the slate-v-01 here.

Download the slate-v-011 here.

Here is a completely black one for VS2008.

February 25th, 2010 — James

Here is the link.

Small basic blog is here.

Embedding didn’t work on this page, so I removed it.

After installing Small Basic, it appeared on the start menu as French. Then it appeared as Russian. Don’t know what next.

February 24th, 2010 — James

There seems to be a bug in the way Dns.GetHostEntry is implemented.

Assume that your server is in a Windows domain but the top DNS suffixis different from the domain name. There are many reasons you may want this.

When you call Dns.GetHostEntry with IP address and host name as the input, you get various outputs depending on where you made the call from.

Case 1: You are on a computer that has domain name as the dns suffix. You call Dns.GetHostEntry with the IP address and host name of a computer with different dns suffix than the domain name.

IPAddress input ->hostname.dns.suffix

Hostname input ->hostname.domain.name

Case 2: You are on a computer that has different dns suffix and domain name. You call Dns.GetHostEntry with the IP address and host name of a computer with different dns suffix than the domain name.

IPAddress input ->hostname.dns.suffix

Hostname input ->hostname.dns.suffix

Case 3: You are on a computer that has different dns suffix and domain name. You call Dns.GetHostEntry with the IP address and host name of the local host. You may also use 127.0.0.1 and localhost.

IPAddress input ->hostname.domain.name

Hostname input ->hostname.domain.name

Bottom line: That host name attribute is not reliable. nslookup always returned the hostname.dns.suffix no matter where the call came from or how I specified the input, IP Address or host name.

Here is a comment from MS Support here: “looking up a host name based on IPAddress is not reliable and in Ipv6 it is not supported”.

A discussion at work with DNS guys suggests that this call may be going to AD (Active Directory) for name resolution. In some cases it may be going to AD first. In those cases it may only be going to AD and never to DNS.

Here is the code to test it:

using System;
using System.Net;

namespace DnsQuery
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                if (1 != args.Length)
                {
                    Console.WriteLine("Usage:");
                    Console.WriteLine("DnsQuery <IP Address>");
                    Console.WriteLine("        OR");
                    Console.WriteLine("DnsQuery <Host Name>");
                    return;
                }
                Console.WriteLine(Dns.GetHostEntry(args[0]).HostName);
            }
            catch (Exception Ex)
            {
                Console.WriteLine(Ex.Message);
            }
        }
    }
}
December 27th, 2009 — James

This happened during an upgrade of Team Foundation Server 2005 to 2008. If you get this error during TFS installation or upgrade, refer to this post.

If you are getting this error elsewhere, there are multiple scenarios that could cause this problem.

Login to the analysis services using the Microsoft SQL Server management studio. In the connection dialog, select server type (that is the first option) as “analysis services”. Expand the databases and select the database with error. Expand data sources and double click the data source name. Click on the connection string and click on the button on the right. Make sure the server name is not FQDN. I have not tried SQL server authentication. Click on the “All” items. If you decided to leave FQDN anyway, make sure workstation ID is not FQDN.

Here are some links:

http://support.microsoft.com/kb/555332

http://blogs.msdn.com/sql_protocols/archive/2008/05/03/understanding-the-error-message-login-failed-for-user-the-user-is-not-associated-with-a-trusted-sql-server-connection.aspx

September 17th, 2009 — James

There are times when you have a limited space to display something inside a grid or list box but needed to display a large text. Like when the user clicks a button to submit data but forgot to enter some input in a list box column.

Here is how to do it from the data template:

<DataTemplate x:Key=...>
<TextBox Text="{Binding FirstName}".../>
<ToolTipService.ToolTip>
<ToolTip Content="{Binding message, Mode=OneWay}"/>
</ToolTipService.ToolTip>
</TextBox>
</DataTemplate>

Now when the user leaves the first name empty, you can just set the message field in the data source and the item will show tool tip.