*1088Appeal from a judgment of the Erie County Court (Timothy J. Drury, J.), rendered March 17, 2004. The judgment convicted defendant, upon a jury verdict, of rape in the first degree, sodomy in the first degree and robbery in the third degree.
It is hereby ordered that the judgment so appealed from be and the same hereby is unanimously affirmed.
Memorandum: Defendant appeals from a judgment convicting him upon a jury verdict of rape in the first degree (Penal Law § 130.35 [1]), sodomy in the first degree (former § 130.50 [1]), and robbery in the third degree (§ 160.05). Contrary to the contention of defendant, County Court did not err in denying his motion seeking to suppress a statement he made to police investigators on the ground that Miranda warnings were not administered and waived by defendant before he made the statement. Although defendant was confined in prison for a different offense at the time he made the statement, the court properly determined that Miranda warnings were not required inasmuch as the questioning of defendant was not in a custodial setting (see People v Alls, 83 NY2d 94, 99-100 [1993], cert denied 511 US 1090 [1994]; People v Georgison, 299 AD2d 176, 176-177 [2002], lv denied 99 NY2d 614 [2003]; see also People v Russin, 277 AD2d 880, 880-881 [2000]). Furthermore, we perceive no reason on the record before us to disturb the court’s determination that defendant spoke willingly with the investigators (see generally People v Prochilo, 41 NY2d 759, 761 [1977]).
Contrary to the further contention of defendant, he received meaningful representation (see generally People v Baldi, 54 NY2d 137, 147 [1981]). We note in particular that, contrary to the contention of defendant in his pro se supplemental brief, he was not denied effective assistance of counsel by defense counsel’s failure to move to dismiss the indictment as time-barred inasmuch as defendant would not have prevailed on such a motion (see People v Lloyd, 23 AD3d 296, 297 [2005]; People v *1089Harrison, 22 AD3d 236 [2005]; see generally People v Rivera, 71 NY2d 705, 709 [1988]). In addition, the record establishes that defendant agreed to provide a DNA sample, and thus it cannot be said that he was denied effective assistance of counsel by defense counsel’s failure to move to suppress the resulting DNA evidence against him for lack of probable cause to order the test. Furthermore, defendant was not denied effective assistance of counsel based on defense counsel’s failure to move for a protective order to preclude the use of DNA evidence on the ground that the use thereof violated defendant’s right to confidentiality inasmuch as that motion also would have been unsuccessful (see Executive Law § 995-d [2]; see generally Rivera, 71 NY2d at 709).
We reject defendant’s contention that the court’s Sandoval ruling constitutes an abuse of discretion (see generally People v Hayes, 97 NY2d 203, 207-208 [2002]; People v Laraby, 219 AD2d 817 [1995], lv denied 88 NY2d 849 [1996]) and, in any event, we conclude that any alleged abuse of discretion with respect to that ruling is harmless (see generally People v Smikle, 1 AD3d 883 [2003], lv denied 1 NY3d 634 [2004]; People v Jacobs, 298 AD2d 954, 955 [2002], lv denied 99 NY2d 559 [2002]). Finally, the sentence is not unduly harsh or severe. Present—Hurlbutt, J.P., Martoche, Pine and Hayes, JJ.