mdvaldosta
mdvaldosta

Reputation: 291

C# and Linq: Generating SQL Backup/Restore From Code

I'm working with a C# and Linq to SQL Winforms app and needed to integrate backup and restores through the program. I used SMO and got it working pretty smoothly. The issue, however, is that the app is deployed using ClickOnce, which I like very much - but since I had to include the dll's the download size jumped from 3mb => 15mb. I know they've only got to download it once, but it also sucks for me as Visual Studio 2010 seems to upload the dll's every time and that takes a while on AT&T broadband (eh).

So, anyone have any suggestion on how I can work out an effective backup/restore solution without using SMO objects?

Upvotes: 0

Views: 2301

Answers (2)

Noel Kennedy
Noel Kennedy

Reputation: 12268

You can just fire plain ol'sql at the box via ado commands

Upvotes: 1

Robert Harvey
Robert Harvey

Reputation: 180918

You can use stored procedures to do backup and restore in lieu of SMO. There are a number of samples available on the web, including this one.

Upvotes: 0

Related Questions