ASP.NET: How to create a connection from a web.config ConnectionString?

后端 未结 3 769
Happy的楠姐
Happy的楠姐 2021-02-14 12:03

How do you construct a DbConnection based on a provider name?

Sample provider names

  • System.Data.SqlClient
  • System.Data.Ol
3条回答
  •  感动是毒
    2021-02-14 12:11

    Check out this Hanselman blog on adding custom build types for different connection strings names, it looks like it may fit what you want to accomplish in a different way than using the provider types.

提交回复
热议问题