mahdishad
چهارشنبه 07 مهر 1389, 22:04 عصر
من برنامه ای با C# و پایگاه داده sqlserverExpress2005 نوشتم که برای اتصال هم از این connection string استفاده کردم.
"server=.\\SQLEXPRESS;AttachDbFilename=" + System.IO.Directory.GetCurrentDirectory() + "\\db\\education_1.mdf;Database=education_1;Trusted _Connection=Yes;Integrated Security=true";
بعد یک install برای برنامم ساختم و ون رو رو کامپیوتر دیگه ای نصب کردم.الان وقتی برنامه نصب شده رو اجرا می کنم sqlserverExpress2005 این error رو میده:
System.Data.SqlClient.SqlException: The log scan number (55:19:2) passed to log scan in database 'education_1' is not valid. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf). If this error occurred during replication, re-create the publication. Otherwise, restore from backup if the problem results in a failure during startup.
Could not open new database 'education_1'. CREATE DATABASE is aborted.
Cannot attach the file 'D:\Program Files\MB\My Product Name\db\education_1.mdf' as database 'education_1'.
درضمن اسم database=education_1'
و برنامه رو تو مسیرزیر نصب کردم :
'D:\Program Files\MB\My Product Name
خواهش میکنم کمکم کنید خیلی برام مهم
"server=.\\SQLEXPRESS;AttachDbFilename=" + System.IO.Directory.GetCurrentDirectory() + "\\db\\education_1.mdf;Database=education_1;Trusted _Connection=Yes;Integrated Security=true";
بعد یک install برای برنامم ساختم و ون رو رو کامپیوتر دیگه ای نصب کردم.الان وقتی برنامه نصب شده رو اجرا می کنم sqlserverExpress2005 این error رو میده:
System.Data.SqlClient.SqlException: The log scan number (55:19:2) passed to log scan in database 'education_1' is not valid. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf). If this error occurred during replication, re-create the publication. Otherwise, restore from backup if the problem results in a failure during startup.
Could not open new database 'education_1'. CREATE DATABASE is aborted.
Cannot attach the file 'D:\Program Files\MB\My Product Name\db\education_1.mdf' as database 'education_1'.
درضمن اسم database=education_1'
و برنامه رو تو مسیرزیر نصب کردم :
'D:\Program Files\MB\My Product Name
خواهش میکنم کمکم کنید خیلی برام مهم