Check your permissions, and that the instance of SQL server is on a machine that has a D: drive.
When I run that code here, on my development SLQ 2008R2 the file is created ok - so you need to look at disk related reasons why it isn't there. If you server is on a machine with a D: drive, then look here:
Backing up an SQL Database in C#[
^] under "So, It'll Work Now?" and check the access permissions for teh folder / user combination.