本文介绍了我该如何使用BackUp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我想备份我创建的数据库visual studio 2010.需要快速回复。我尝试创建SP ALTER PROCEDURE DBBackUp / * ( @ parameter1 int = 5, @ parameter2 datatype OUTPUT ) * / AS - 添加SET NOCOUNT ON以防止来自 的额外结果集 - 干扰SELECT语句。 BACKUP DATABASE ExeDemoWithBackUp 要DISK ='D:\DatabaseBackUp \Billing.Bak' WITH FORMAT, MEDIANAME ='MyBilling', NAME ='账单完全备份'; 返回 和还使用以下代码 // ServerConnection con = new ServerConnection(conn); //服务器服务器=新服务器(con) ; //备份源=新备份(); //source.Action = BackupActionType.Database; //source.Database =ExeDemoWithBackUp; // BackupDeviceItem destination = new BackupDeviceItem(@D:\DatabaseBackUp,DeviceType.File); //source.Devices.Add (目的地); //source.SqlBackup(server); //con.Disconnect(); // String filePath = @D:\DatabaseBackUp; // String databaseName =ExeDemoWithBackUp; 但我得到一个错误ExeDemoWithBackUp不存在。 请你在这里回复我或者你甚至可以分享我的博客 [LINK DELETED] 解决方案 试试这个:用C#备份SQL数据库 [ ^ ] Hi, I want to take backup of my database which I had created in visual studio 2010. Need a quick response. I tried by creating SPALTER PROCEDURE DBBackUp/*(@parameter1 int = 5,@parameter2 datatype OUTPUT)*/AS-- SET NOCOUNT ON added to prevent extra result sets from-- interfering with SELECT statements.BACKUP DATABASE ExeDemoWithBackUpTO DISK = 'D:\DatabaseBackUp\Billing.Bak' WITH FORMAT, MEDIANAME = 'MyBilling', NAME = 'Full Backup of Billing';RETURN and also using the following code //ServerConnection con = new ServerConnection(conn); //Server server = new Server(con); //Backup source = new Backup(); //source.Action = BackupActionType.Database; //source.Database = "ExeDemoWithBackUp"; //BackupDeviceItem destination = new BackupDeviceItem(@"D:\DatabaseBackUp", DeviceType.File); //source.Devices.Add(destination); //source.SqlBackup(server); //con.Disconnect(); //String filePath = @"D:\DatabaseBackUp"; //String databaseName = "ExeDemoWithBackUp"; but I am getting a error ExeDemoWithBackUp doesn't not exists.Please you can reply me about this here or you can even share in My Blog[LINK DELETED] 解决方案 Try this: Backing up an SQL Database in C#[^] 这篇关于我该如何使用BackUp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-23 02:24