Two or more offenses may be charged in the same indictment or information in separate counts for each offense, if the offenses charged, whether felonies or misdemeanors or both, are of the same or similar character or are based on the same act or transaction or on two or more acts or transactions connected together or constituting parts of a common scheme or plan.
SDCL 23A-6-23