ورود

View Full Version : خطادر restore



hamide_kh
پنج شنبه 28 خرداد 1388, 19:21 عصر
با عرض سلام خدمت دوستان
من با یک برنامه که برای backup گیری با c# نوشتم یک back up از دیتابیس testگرفتم اما وقتی می خوام restore کنم این خطا رابهم میده،به نظر شما مشکل از چیست؟
System.Data.SqlClient.SqlError: The tail of the log for the database "test" has not been backed up. Use BACKUP LOG WITH NORECOVERY to backup the log if it contains work you do not want to lose. Use the WITH REPLACE or WITH STOPAT clause of the RESTORE statement to just overwrite the contents of the log. (Microsoft.SqlServer.Smo)

mohsen_csharp
پنج شنبه 28 خرداد 1388, 20:11 عصر
دوست عزیز شما باید برای متغیر restore کد زیر رو فعال کنید

sqlRestore.ReplaceDatabase = true;
در ضمن یک نمونه برنامه کامل اینجاست
http://barnamenevis.org/forum/showthread.php?t=153480&highlight=smo