2
Reply

Write a Connection-string applicable for Entity Framework Codefirst and explain how it is recognised

Pavan Ramamurthy

Pavan Ramamurthy

13y
2.4k
2
Reply

    A clear explanation of how the framework recognizes and uses the connection string can save developers a lot of debugging time. I always appreciate guides that include practical examples alongside the theory, as they make the concepts much easier to apply. Even when I take a break with Veck IO, I enjoy coming back to technical articles that help strengthen my development skills. This is a useful subject for both beginners and experienced .NET developers.

    der Lean
    Jul 22
    0
    In the above context class, we specify a connection string name as a parameter. Please note that the connection string name should start with "name=", otherwise it will consider it as a database name. The database name in the connection string in app.config is SchoolDB-ByConnectionString. EF will create a new SchoolDB-ByConnectionString database or use the existing SchoolDB-ByConnectionString database in the local SQL Server. Make sure that you include providerName = "System.Data.SqlClient" for the SQL Server database in the connection string.