C# 和 Linq:从代码生成 SQL 备份/恢复
我正在使用 C# 和 Linq to SQL Winforms 应用程序,需要通过该程序集成备份和恢复。我使用了 SMO,并且运行得非常顺利。然而,问题是该应用程序是使用 ClickOnce 部署的,我非常喜欢这种方式 - 但由于我必须包含 dll,所以下载大小从 3mb => 增加到 3mb。 15MB。我知道他们只需下载一次,但这对我来说也很糟糕,因为 Visual Studio 2010 似乎每次都会上传 dll,而这在 AT&T 宽带上需要一段时间(呃)。
那么,有人对如何在不使用 SMO 对象的情况下制定有效的备份/恢复解决方案有任何建议吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以通过 ado 命令在框中发送普通的 ol'sql
You can just fire plain ol'sql at the box via ado commands
您可以使用存储过程代替 SMO 进行备份和恢复。网络上有许多示例,包括这个。
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.