---
# System prepended metadata

title: c#-3
tags: [資安筆記-c#]

---

---
title: c#-3
tags: 資安筆記-c#
---
https://docs.microsoft.com/zh-tw/sql/ssms/download-sql-server-management-studio-ssms?view=sql-server-ver15

連線要用SQL
![](https://i.imgur.com/zc72WIK.png)
![](https://i.imgur.com/Z3Wh2n8.png)
![](https://i.imgur.com/ugIOd8C.png)
![](https://i.imgur.com/UFWNTgA.png)
![](https://i.imgur.com/m6SZ2Qh.png)
![](https://i.imgur.com/vk6Amzy.png)

----
![](https://i.imgur.com/YcrJJUU.png)

![](https://i.imgur.com/RTkuMxm.png)
![](https://i.imgur.com/WVCFwuN.png)
![](https://i.imgur.com/LZmPq3s.png)

----
編輯完要打dotnet run才會動
![](https://i.imgur.com/s2Mb9vo.png)
<span>編號：</span>@Html.TextBoxFor(m => m.CustomerID) <br/>
這個要拿掉.因為會自己新增
----
https://docs.microsoft.com/zh-tw/ef/core/get-started/?tabs=netcore-cli
要學會看C#的文件
---
裝dotnet add package Microsoft.EntityFrameworkCore
和 dotnet add package Microsoft.EntityFrameworkCore.SqlServer
的套件(要看是連到哪個資料庫)

using Microsoft.EntityFrameworkCore.SqlServer;
要自己用手打
![](https://i.imgur.com/AcQtKMu.png)
![](https://i.imgur.com/F2iw7hR.png)
密碼要自己改

-----
學習偵錯點
![](https://i.imgur.com/CbFSKd5.png)

![](https://i.imgur.com/ESjV3UT.png)
https://localhost:5001/Customers/Create

https://localhost:5001/Customers/Create
輸入要依照日期或名字或照片檔
----

dotnet tool install --global dotnet-ef
dotnet add package Microsoft.EntityFrameworkCore.Design
dotnet ef migrations add InitialCreate
dotnet ef database update

---
8/29從這裡開始複習~

加入dotnet add package Microsoft.Extensions.Configuration
程式碼再加入
using Microsoft.Extensions.Configuration;

----
![](https://i.imgur.com/A0v788r.png)
