Get the Entity Framework Connection String

前端 未结 11 982
迷失自我
迷失自我 2021-01-31 02:27

We use Entity Framework 5, but have a requirement to ALSO use a normal database connection from the application for some custom SQL we need to perform.

So, I am creating

11条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-31 03:21

    even in EF3 you can use EntityConnectionStringBuilder.

    EntityConnectionStringBuilder conn = 
        new EntityConnectionStringBuilder(DBEntities.dbConnection);
    SqlConnection s = new SqlConnection(conn.ProviderConnectionString);
    

提交回复
热议问题