I am not a lawyer, but you can leave your firearm in your vehicle while you take care of your business in a building or facility that does not allow firearms. A firearm is a significant investment so if your going to leave a gun in you car get a lock box that is intended for firearm storage and mount it in your car.
That being said if it is a business like a ice cream shop that bans firearms as a matter of policy not state or federal law, and you bring your firearm you they can only ask you leave (if they discover your are possessing a firearm). At which point you leave or face trespassing charges and you my also get banned from that establishment. It's best just to politely apologize to the employee/manager and leave they probably have no control over cooperate policy, just write a letter to mangment questing the rationale of the policy.
For state of federal property or places where firearms are banned as a matter of law even leaving your firearm in your car my still be illegal, 18USC930 has been applied to parking lots for federal building (when the parking lot is owned or leased by the federal government). My advice if it's a federal building don't even leave it in you car, leave it home or what I've done in past park across the street from the post office and then leave it in the car. The same for state property where firearms are banned.