• If you are executing

    exec sp_restoredb N'mydatabase', N'D:\mydatabase.bak'

    it means database on which you want to do restore is mydatabase with mdf,ldf and one or more ndf files and backup using which you want to do restore operation is mydatabase.bak(having same number of ndf files as that of my database on which restore will occur).Kindly check this, it its fine then no error may occur while execution.