关于进行数据库备份

问题描述:

我已经开发了一个基于Windows的软件
最初是通过以下方式从c#前端调用以下查询来提供对硬盘驱动器进行数据库备份的条款:

将数据库hm备份到磁盘=''C:\\ hm.bak

但是现在我必须将系统部署到客户端,并且没有数据库,因为连接字符串指向数据库的.mdf文件.实际的SQL Server不存在
所以我应该如何进行数据库备份

I have developed one windows based software
initially in that there was a provision for taking database backup on hard disk drive by calling following query from c# front end like this

backup database hm to disk = ''C:\\hm.bak

But now i have to deploy system to client side and there is no database as connection string is pointing to the .mdf file of database. actual sql server is not there
so how should i take database backup

您可以尝试 ^ ]方法? (在打开数据库之前使用它,否则它可能会失败)
You could try the File.Copy[^] method? (Use it before you open the database or it will likely fail)