I am working on C# and Entity Framework. I delved into the logical side of things a bit to learn the ORM logic. However, I encountered an error while working. The error occurred as follows: I used the embedded SQL used for testing in the SQL Server Object Explorer section in Visual Studio as the database.
After creating the database and tables, I noticed something. The person in the video I was following had the app.config file ready when creating the project, but I didn't have it ready. Therefore, I created the app.config file myself and added the connection string to it. You can see my app.config configuration file below:
However, the issue is that when I run the code, I am unable to find a database connection and it gives me the following error:" enter image description here
I am a beginner and I am unable to solve this error. To provide you with more information, I am sharing the files and codes in my project below.
This image contains the files and an overview of the project
ETradeContext class: enter image description here
Form1 class:
Program class: enter image description here
To be honest, I think the project needs to recognize the app.config file somehow and do it in the program class, and I don't know how to do that
PLEASE HELP MEE!!
I have tried many things, but I have not been able to get any specific results. Usually, on the internet, this problem is related to an existing database, so even though the question seems the same, the solutions are not. I am not someone who memorizes things, and I want to learn this virtual database that comes embedded with the ORM logic for testing purposes and solve this problem. Please help me