Quantcast
Viewing latest article 1
Browse Latest Browse All 2

Datetime nullable

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 latest article 1
Browse Latest Browse All 2

Trending Articles



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