Quantcast
Channel: Datetime nullable
Viewing all articles
Browse latest Browse all 2

Datetime nullable

$
0
0

hola

pero para que funcione tienes que hacer la variable acepte nulos

DateTime? fechaVisitaCompra = row.Cells["fechaVisitaCompra"].Value == System.DBNull.Value ? null : Convert.ToDateTime(row.Cells["fechaVisitaCompra"].Value);

como veras se define el "?" indicando que puede tomar un null como valor


saludos


Leandro Tuttini

Blog
MVP Profile
Buenos Aires
Argentina


Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>