code_junkie

.NET time sinkholes?

Nov 11th, 2011
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. int? myIntValue =
  2. dataReader.IsDBNull("ColumnName") ? null :
  3. dataReader.GetInt32("ColumnName");
  4.  
  5. int? myIntValue;
  6.  
  7. if(dataReader.IsDBNull("ColumnName"))
  8. {
  9. myIntValue = null;
  10. }
  11. else
  12. {
  13. myIntValue = dataReader.GetInt32("ColumnName");
  14. }
  15.  
  16. int? myIntValue =
  17. dataReader.IsDBNull("ColumnName") ? (int?)null :
  18. (int?)dataReader.GetInt32("ColumnName");
  19.  
  20. Copy | Link | Move | Scroll
  21.  
  22. Copy | Move | Scroll
  23.  
  24. var adEntry = new DirectoryEntry("LDAP://...");
  25. adEntry.DoSomething(); // Throws meaningless COMException! Sometimes a different one!
  26.  
  27. adEntry = new DirectoryEntry("ldap://...");
  28. adEntry.DoSomething(); // Works.
  29.  
  30. DateTime someDateTime = new DateTime(2008, 1, 1);
  31.  
  32. for i = 1 to nGrids
  33. grids[i] = new Grid(templateGrid) // assuming copy constructor semantics
  34. delete templateGrid
  35.  
  36. for i = 1 to nGrids
  37. grids[i] = templateGrid.Clone()
  38. delete templateGrid
Add Comment
Please, Sign In to add comment