InvalidCastException CreateGetBytesOnInvalidColumnTypeException (int ordinal)
{
string message = string.Format (CultureInfo.InvariantCulture,
"Invalid attempt to GetBytes on column '{0}'." +
"The GetBytes function can only be used on " +
"columns of type Text, NText, or Image.",
GetName (ordinal));
return new InvalidCastException (message);
}