+10  A: 
int? x = string.IsNullOrEmpty(cert) ? (int?)null : int.Parse(cert);
Mehrdad Afshari
beautiful. Thanks!
Hcabnettek
+1  A: 

I've come across the same thing ... I usually just cast the null to (int?)

int? x = (string.IsNullOrEmpty(cert)) ? (int?)null: int.Parse(cert);
Scott Vercuski