Geeks With Blogs
Fórmulas e Cenas Object Reference Not Set to an Instance of an Object

In this category I will post some "creative" solutions to problems. (Code changed to protect the inocents).


// The WTF way

int  myInt = Int32.Parse(myDataTable.Rows.Count + "");

// The correct way

int  myInt = myDataTable.Rows.Count;

Posted on Monday, December 14, 2009 5:37 AM C# , Fun | Back to top

Comments on this post: WTF #1

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Sglima | Powered by: