来自域的数据库备份 [英] Database backup from domain

查看:75
本文介绍了来自域的数据库备份的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友您好,



我已经使用以下代码在c#的asp.net项目中通过iis备份数据库。





 SqlCommand cmd =  new  SqlCommand( 备份数据库dbname to disk ='D:backupdb \\dbname.Bak',con); 
cmd.ExecuteNonQuery();







但是在域名i上传相同的项目后访问被拒绝到该文件夹​​时出现错误。



请有人帮助我

解决方案

嗯。

您的生产SQL服务器是否有D:驱动器?你有没有访问它?



两个问题的答案可能是不,除非你正在做自己的托管:如果你使用托管服务,那么默认情况下您不太可能有任何访问权限,托管公司也不太可能愿意为您提供访问权限!



有一个看看这个:用C#备份SQL数据库 [ ^ ]

它提供了一种备份到你的网站PC上的方法,而不是SQL服务器本身(当你想到它时这是一个好主意!)


< blockquote>你好,



您是否尝试授予您的文件夹完全权限?从上面的错误看,似乎是权限问题。


Hello friends,

I have used the following code to take backup of database through iis in my asp.net project in c#.


SqlCommand cmd = new SqlCommand("backup database dbname to disk='D:backupdb\\dbname.Bak'", con);
                cmd.ExecuteNonQuery();




But after uploading the same project on domain i was getting error as Access Denied to the folder.

Please somebody help me

解决方案

Um.
Does your production SQL server have a D: drive? Do you have any access to it?

The chances are that the answer to both questions is "no" unless you are doing your own hosting: if you use a hosting service, then it is very unlikely that you will have any access by default, and even less likely that the hosting company will be willing to give you access!

have a look at this: Backing up an SQL Database in C#[^]
It provides a way to get a backup onto your website PC, rather than the SQL sever itself (which is a good idea when you think about it!)


Hi there,

Have you try to give full permission to your folder? From the error above, it seems the permission problem.


这篇关于来自域的数据库备份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆