Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

Object cannot be cast from DBNull to other types

$
0
0

i have column startDate of type DATE in sql 2008.

i am trying to pick that from database and binding it to a label in asp.net , it works :) by converting it to string.

but problem is that it isn't picking a record for which date is null. it throws error

"Object cannot be cast from DBNull to other types"

why ?


Viewing all articles
Browse latest Browse all 23244

Trending Articles



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