خرید بک لینک
سلام وقت بخیر من در نسخه های قبلی نرم افزار توسط کد زیر بک آپ میگرفتم که الان خطا بهم میده؟
خطا را هم پیوست کردم میتونید ببینید.
با تشکر
            PerViewEntities db = new PerViewEntities();
db.Dispose();SqlCommand oCommand = null;
SqlCoection oCoection = null;
try
{
string ConectionString =
@"Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirector y|PerView.mdf;Integrated Security=True;User Instance=True";
string Command = @"backup database [" + Application.StartupPath + "\PerView.mdf] to disk ='" +strFileName + "' with init,stats=10";this.Cursor = Cursors.WaitCursor;oCoection = new SqlCoection(ConectionString);
if (oCoection.State != CoectionState.Open)
oCoection.Open();oCommand = new SqlCommand(Command, oCoection);
oCommand.ExecuteNonQuery();this.Cursor = Cursors.Default;
MessageBoxFarsi.Show("از اطلاعات بانک نسخه پشتیبانی تهیه شد.");
}
catch (Exception ex)
{
MessageBoxFarsi.Show("خطا :" + ex.Message);
}
finally
{
oCoection.Close();
//oCommand.Parameters.Clear();
oCommand.Dispose();
}

برچسب: میگرفتم, نویسنده: محمد رضا جوادیان تاريخ: جمعه 31 شهريور 1396 ساعت: 17:15

صفحه بندی