As a Dynamics CRM developer we always come across the error saying that 'The Given Key is not present in dictionary'.
The reason we receive this error message because of below issues:-
When we try to get the attribute value from Entity object without checking the attribute.
The above line will throw error if ObjAccount doesn't contains this attributes.
TO fix this we should always check attributes in Entity object then get the value.
We can also use below code which will return null if attribute is not present in Entity object.