Register
Sunday, February 05, 2012
 
 DBAs And ProgrammersBlog
  
News! Minimize
   
 
 Print   
 
Misc Blog Stuff Minimize
   
 
 Print   
 
The Reluctant DBA Minimize
 
 
 
 Print   
 
Reluctant DBA Minimize
   
 
  
 
Reluctant DBA Minimize
   
 
  
 
The Reluctant DBA Minimize
 
Mar26

Written by:CarpDeus
3/26/2010 8:22 AM 

So, this morning I encountered an error that was new to me, one of those errors that makes perfect sense when you think about it, however. The error was one that offered common sense help as well that is totally useless:

MustBeLessThanInfinity

Sorry for the image, I couldn't get a screen shot except by using my camera phone... for some reason Paint Shop Pro wouldn't capture the float.

Yes, when casting from a number, the value must be less than infinity. Which makes one wonder how much less than infinity? C#'s unsigned, 64-byte int (uint64) supports a value of 18446744073709551615. The following line of code:

UInt64 ui = Convert.ToUInt64("18446744073709551616");

results in a Value was either too large or too small for a UInt64. Leaving aside for a moment the fact that this is a past tense statement which might imply that the value could be right-sized now and the grammatical error of using a before a vowel sound and U is definitely a vowel sound, it's a fairly concise error. Also, it has a finitely defined value. The error above can easily be recreated, just use the following:

UInt64 ui = Convert.ToUInt64(DBNull.Value);

This moment of silliness has been brought to you by the letters M,S and C and the symbol #.

Tags:

Your name:
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Add Comment  Cancel 
 
 
  
 
Privacy Statement | Terms Of Use Copyright 2001-2008 by ReluctantDBA.com