iT邦幫忙

0

請問 Visual Studio macos .Net 5.0 要怎麼連接Sql Server

Sql Server 都已經用 Docker弄好了

可是爬了文發現大家都用 EF Core的 Scaffold-DbContext

不過mac好像不能用 https://ithelp.ithome.com.tw/upload/images/20210929/20137886IZmPeOLkuG.png

請問還有什麼方法可以連接 Sql Server嗎

Homura iT邦高手 1 級 ‧ 2021-09-29 14:45:42 檢舉
一樣建立連接字串連
你是連遠端的嗎?
s10730047 iT邦新手 5 級 ‧ 2021-09-29 14:48:07 檢舉
用Docker應該是連遠端嗎? 資料庫還是loaclhost
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

2 個回答

2
asd3733653
iT邦新手 2 級 ‧ 2021-09-29 14:50:02
最佳解答

我猜你應該是沒有安裝
Install-Package Microsoft.EntityFrameworkCore.SqlServer –Pre
Install-Package Microsoft.EntityFrameworkCore.Tools –Pre
Install-Package Microsoft.EntityFrameworkCore.SqlServer.Design –Pre
這幾個包
Command才會無法識別Scaffold-DbContext

猜錯鞭小力一點/images/emoticon/emoticon02.gif

s10730047 iT邦新手 5 級 ‧ 2021-09-29 16:10:34 檢舉

這個我有裝了 還是感謝解答~

1
Homura
iT邦高手 1 級 ‧ 2021-09-29 14:57:26
看更多先前的回應...收起先前的回應...
s10730047 iT邦新手 5 級 ‧ 2021-09-29 16:10:11 檢舉

他出現
No DbContext was found in assembly 'BabyRecords-Server'. Ensure that you're using the correct assembly and that the type is neither abstract nor generic.

Homura iT邦高手 1 級 ‧ 2021-09-29 16:20:40 檢舉

s10730047
建立dbcontext是否有做完?
參考
https://ithelp.ithome.com.tw/articles/10196856

s10730047 iT邦新手 5 級 ‧ 2021-09-29 20:30:01 檢舉

有了 感謝!

Homura iT邦高手 1 級 ‧ 2021-09-30 09:55:17 檢舉

s10730047
疑?結果你是用上面那位解答解決的啊?
看你選他正解@@

s10730047 iT邦新手 5 級 ‧ 2021-09-30 13:46:33 檢舉

啊...對不起...手殘按錯...

Homura iT邦高手 1 級 ‧ 2021-09-30 13:52:01 檢舉

/images/emoticon/emoticon04.gif

will89117 iT邦新手 4 級 ‧ 2023-05-27 16:24:42 檢舉

想問DB first也是ㄧ樣的方式嗎

Homura iT邦高手 1 級 ‧ 2023-06-18 03:34:20 檢舉

will89117 都是用一樣的方法

我要發表回答

立即登入回答