問題描述
我安裝了 DevExpress 演示
I installed the DevExpress demo
C:\Users\Public\Documents\DevExpress Demos 15.2\DevExtreme\DXHotels
該演示隨附在 App_Data 文件夾中的 HotelDB.mdf.
The demo came with HotelDB.mdf in the App_Data folder.
出于好奇,我試圖通過嘗試使用 SQL Server 2012 Express Management Studio 附加它來打開 HotelDB.mdf
Out of curiosity I attempted to open the HotelDB.mdf by attempting to attach it using SQL Server 2012 Express Management Studio
但是,我在執行此操作時收到有關丟失日志文件的錯誤.
However I got an error about a missing log file when I did this.
當我從解決方案中運行應用程序時,會創建日志文件,隨后我可以使用 SQL Server 進行附加.
When I ran the application from the solution the log file created and I was able to subsequently attach using SQL Server.
為什么應用程序可以打開文件而 Management Studio 不能打開?
Why was the application able to open the file when Management Studio could not?
推薦答案
嘗試以下方法之一......
Try one of the following ......
CREATE DATABASE HotelDB
ON (FILENAME = N'C:\App_Data\HotelDB.mdf') --<-- The path to your .mdf
FOR ATTACH_REBUILD_LOG
GO
或
CREATE DATABASE HotelDB
ON (FILENAME = N'C:\App_Data\HotelDB.mdf') --<-- The path to your .mdf
FOR ATTACH
GO
這篇關于應用程序可以在沒有日志文件的情況下打開 .mdf 但 Management Studio 無法附加的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!