Error Object cannot be cast from DBNull to other types.Posted: 22/02/2012
This happens when the database is returning an object of type DBNull. Best approach towards handling this error would be to check if the object is of type DBNull first, before attempting to use it. Sample snippet below demonstrates this, using the Convert.IsDBNull method.
Hope this helps.