开发者

SQL Backup to Isolated storage from ADO.NET

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

开发者_开发知识库

Thanks


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜