System.InvalidCastException Unable to case object of type ‘System.DBNull’ to type ‘System.string’

System.InvalidCastException Unable to case object of type ‘System.DBNull’ to type ‘System.string’

PROBLEM

  • When trying to print a message to a Selection Rule, on the Contact Groups screen of the Send Message window when you click on the "Next" button you get the Error Message: System.InvalidCastException: Unable to cast object of type 'System.DBNull' to type 'System.String'. 

CAUSE

The first CG record in the Selection Rule is essentially blank, missing the CG Name, Individuals information, and a mailing address. 

SOLUTION

Since the CG record is blank and doesn’t contain anything, you can go ahead and delete the record from Gorilla using the instructions in the article How to Downline/Delete a Contact Group.

Once it is no longer in the selection rule, try sending the message again.