views:

21

answers:

2

Hi All,

Is it possible to create an SQL server database backup using c# ADO.net and outputting the .BAK file to Isolated storage?

Thanks

+1  A: 

No. Because there is no way to get access to the isolated storage PATH by program, you can not tell SQL Server to put things there.

Also, for anything but the most trivial applications, the size limit on isolated storage would be a joke compared what you need for a db backup.

TomTom
+1  A: 

What kind of isolated storage are you referencing?

How about:

  • create a stored proc to perform the backup.

    BACKUP DATABASE [Foo] TO DISK = N'\\server\directory\Foo.BAK' WITH NOFORMAT, NOINIT,
    NAME = N'Foo-FullBackup', SKIP, NOREWIND, NOUNLOAD, STATS = 10 GO

  • call this stored proc on the SQL Server from your C# client code

  • depending on your needs (isolated storage?) use System.IO.File.Move() to move the .BAK file from its source to your destination.

p.campbell