解決 | 此資料庫檔案跟當前sql server例項不相容 & sql server2008無法連線到(local)
阿新 • • 發佈:2018-11-12
最近在搞ASP.NET,因實驗室VS版本跟PC不一樣可能,拷回來一開啟就這樣子:
![9125154-15a0be51d0a6a647.png](https://upload-images.jianshu.io/upload_images/9125154-15a0be51d0a6a647.png)
眉頭一皺的我開啟我的古董SQL,自從用了MySQL就沒碰它了我的鍋。。。果然。。連線的時候。。。
![9125154-4beb60477e6c80a4.png](https://upload-images.jianshu.io/upload_images/9125154-4beb60477e6c80a4.png)
不慌,(win 10)開啟控制面板\系統和安全\管理工具 ->服務,
![9125154-e7b169c0b2e2fc46.png](https://upload-images.jianshu.io/upload_images/9125154-e7b169c0b2e2fc46.png)
![9125154-ce6235fe77aa541b.png](https://upload-images.jianshu.io/upload_images/9125154-ce6235fe77aa541b.png)
找到SQL Server(MSSQLSEVER),右鍵,啟動或重啟動:
![9125154-2d15805f47ea3984.png](https://upload-images.jianshu.io/upload_images/9125154-2d15805f47ea3984.png)
讀條,完了之後看狀態,正在執行咯:
![9125154-c200c0b236017d6b.png](https://upload-images.jianshu.io/upload_images/9125154-c200c0b236017d6b.png)
![9125154-c9363f3f2121476b.png](https://upload-images.jianshu.io/upload_images/9125154-c9363f3f2121476b.png)
一頓騷(cainiao)操作之後,再次開啟sql,完美解決了,連線成功:
![9125154-c1957a3757be81f2.png](https://upload-images.jianshu.io/upload_images/9125154-c1957a3757be81f2.png)
接著VS點選連線到資料庫:
![9125154-144d819afff991be.png](https://upload-images.jianshu.io/upload_images/9125154-144d819afff991be.png)
接下來有兩種方法:
方法一(推薦,簡單粗暴):
直接在彈出來的視窗中選擇好路徑後點擊確定:
![9125154-941c623586b9c489.png](https://upload-images.jianshu.io/upload_images/9125154-941c623586b9c489.png)
然後會提示如下,繼續點選確定即可:
![9125154-acd23693fc480af2.png](https://upload-images.jianshu.io/upload_images/9125154-acd23693fc480af2.png)
搞定:
![9125154-bd68c501ef718d40.png](https://upload-images.jianshu.io/upload_images/9125154-bd68c501ef718d40.png)
方法二(僅供參考):
![9125154-c564a227b44cbe13.png](https://upload-images.jianshu.io/upload_images/9125154-c564a227b44cbe13.png)
![9125154-c25b7d85c233d105.png](https://upload-images.jianshu.io/upload_images/9125154-c25b7d85c233d105.png)
![9125154-fe8cad801d445a20.png](https://upload-images.jianshu.io/upload_images/9125154-fe8cad801d445a20.png)
完了點選確定即可。
附記:補充更新安裝ASP.NET 工具:
![9125154-22740681c51f64c4.png](https://upload-images.jianshu.io/upload_images/9125154-22740681c51f64c4.png)