用 Scaffold-DbContext 指令時遇到「Login failed. The login is from an untrusted domain and cannot be used with Integrated authentication.」錯誤訊息!?
呃,應該是說之前為什麼沒遇到這問題吧
因為之前用Scaffold建置EF時是連到本機的資料庫,而這次是連接remote sql server的資料庫
所以原先的 connection string --「"Server=遠端DBIP;Database=資料庫;Trusted_Connection=True;"」
要改成「"Server=遠端DBIP;Database=資料庫;;User ID=帳號;Password=登入密碼;Trusted_Connection=True;"」 是的,題就出在trusted connection
以上參考這篇
老句話,要執行Scaffold指令前別忘了備份一下專案(最少DBcontext檔要備份)
新年快樂
0 個意見:
張貼留言
訂閱 張貼留言 [Atom]
<< 首頁