iT邦幫忙

0

C# 匯入SQL失敗

  • 分享至 

  • twitterImage

各位大大好
學長傳了一個範例給我練習
壓縮檔案裡包含C#程式和SQL檔案

如果一般匯入方法 會找不到檔案
https://ithelp.ithome.com.tw/upload/images/20210524/20136646skroQOLyyT.png
https://ithelp.ithome.com.tw/upload/images/20210524/20136646pGnj0T5ykK.png
https://ithelp.ithome.com.tw/upload/images/20210524/20136646ZvMk9xshHH.png

後來我直接打開SQl檔案 f5執行
https://ithelp.ithome.com.tw/upload/images/20210524/20136646T1Umb0FDjI.png
https://ithelp.ithome.com.tw/upload/images/20210524/20136646hLXJcKdX8r.png
https://ithelp.ithome.com.tw/upload/images/20210524/20136646DDzJIPMCmf.png

出現
使用者沒有改變資料庫 'MVC' 的權限、該資料庫不存在,或資料庫不是處於允許存取檢查的狀態。

為什麼呢... 是因為沒有權限嗎 還是因為有少步驟
如果有權限的話 我還能用原本的c#網頁嗎
還是一定要串聯資料庫呢

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

2 個回答

0
純真的人
iT邦大師 1 級 ‧ 2021-05-24 15:05:14
最佳解答

那個要看你SQL安裝的實際路徑~
你要修正正確資料夾路徑~
前面第一個錯~後面就全錯@@..
https://ithelp.ithome.com.tw/upload/images/20210524/20061369piJ92ll13N.png
https://ithelp.ithome.com.tw/upload/images/20210524/20061369hQunWJLZtz.png

原來如此 我嘗試看看謝謝您!

0
小魚
iT邦大師 1 級 ‧ 2021-05-24 18:27:53

我的做法通常是直接刪除最前面那幾行,
就解決了 XD

因為每台電腦的路徑都不一樣.

我要發表回答

立即登入回答