I am programming an ASP.NET Core project with Razor pages, which is database first.
After executing the Scaffold-DbContext
command in Power Console Manager, the classes and context were created correctly and after running the program, the data was read correctly from the tables. Then I moved the connection string from context
to appsettings
and also the name of the connection string to the context and replaced the connection string, and after this step everything still worked properly.
Now after the changes I made in the tables through SSMS, I again run Scaffold-Dbcontext
in order to receive the changes of the tables and I changed the connection string name to context again, but this time after running the program and while reading data from the tables, the following I get this error :
System.ArgumentException
HResult=0x80070057
Message=Format of the initialization string does not conform to specification starting at index 0.
Summary: When the connection string is in context (like the default state), it works correctly. But when I save the name of the connection string in the context, it encounters a data call error
I have attached pictures of the current situation, please take a look and tell me where I am doing wrong. ????