The phrase "elementary my dear Watson" does not appear in any of Sir Arthur Conan Doyles novels of the adventures of the famous detective Sherlock Holmes. This phrase was only used in the television adaptations that have famously coined the phrase.
In fact, the terms "Elementary" and "My Dear Watson", although used in the program, are never in sequence. One of the closest examples of this phrase appears in "The Adventure of the Crooked Man", when Holmes explains a deduction: "'Excellent!' Watson declared, to whom Holmes responded, ''Elementary''.