我用的是sql
这是我在网上找的:可我不明白是什么意思呀
/// 数据库备份
3 ///
4 /// 备份是否成功
5 public bool DbBackup()
6 {
7 string path = CreatePath();
8 SQLDMO.Backup oBackup = new SQLDMO.BackupClass();
9 SQLDMO.SQLServer oSQLServer = new SQLDMO.SQLServerClass();
10 try
11 {
12 oSQLServer.LoginSecure = false;
13 oSQLServer.Connect(server,uid, pwd);
14 oBackup.Action = SQLDMO.SQLDMO_BACKUP_TYPE.SQLDMOBackup_Database;
15 oBackup.Database = database;
16 oBackup.Files = path;
17 oBackup.BackupSetName = database;
18 oBackup.BackupSetDescription = "数据库备份";
19 oBackup.Initialize = true;
20 oBackup.SQLBackup(oSQLServer);
21
22 return true;
23 }
24 catch(Exception ex)
25 {
26 return false;
27 throw ex;
28 }
29 finally
30 {
31 oSQLServer.DisConnect();
32 }
33 }