reza69
شنبه 04 مرداد 1393, 18:00 عصر
سلام
من تو VS2012 موقعی که پروژه رو اجرا میکنم میتونم بک آپ بگیرم ولی وقتی پروژه رو آپ میکنم ارور میده نمیدونم چرا؟
PersianCalendar p = new PersianCalendar();
DateTime dmiladi = new DateTime();
dmiladi = DateTime.Now;
string bname = p.GetYear(dmiladi).ToString() + "/" + p.GetMonth(dmiladi).ToString() + "/" + p.GetDayOfMonth(dmiladi).ToString();
con.Open();
SqlCommand command;
command = new SqlCommand(@"backup database esb to disk ='c:\" + DateTime.Now.ToString("yyyy-MM-dd-HH-mm") + ".bak' with init,stats=10", con);
command.ExecuteNonQuery();
con.Close();
lblmessage.Text = "عملیات گرفتن نسخه پشتیبان با موفقیت انجام شد ";
متن ارور
Cannot open backup device 'c:\2014-07-26-18-34.bak'. Operating system error 5(Access is denied.).
BACKUP DATABASE is terminating abnormally. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Cannot open backup device 'c:\2014-07-26-18-34.bak'. Operating system error 5(Access is denied.).
BACKUP DATABASE is terminating abnormally.
من تو VS2012 موقعی که پروژه رو اجرا میکنم میتونم بک آپ بگیرم ولی وقتی پروژه رو آپ میکنم ارور میده نمیدونم چرا؟
PersianCalendar p = new PersianCalendar();
DateTime dmiladi = new DateTime();
dmiladi = DateTime.Now;
string bname = p.GetYear(dmiladi).ToString() + "/" + p.GetMonth(dmiladi).ToString() + "/" + p.GetDayOfMonth(dmiladi).ToString();
con.Open();
SqlCommand command;
command = new SqlCommand(@"backup database esb to disk ='c:\" + DateTime.Now.ToString("yyyy-MM-dd-HH-mm") + ".bak' with init,stats=10", con);
command.ExecuteNonQuery();
con.Close();
lblmessage.Text = "عملیات گرفتن نسخه پشتیبان با موفقیت انجام شد ";
متن ارور
Cannot open backup device 'c:\2014-07-26-18-34.bak'. Operating system error 5(Access is denied.).
BACKUP DATABASE is terminating abnormally. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Cannot open backup device 'c:\2014-07-26-18-34.bak'. Operating system error 5(Access is denied.).
BACKUP DATABASE is terminating abnormally.