如何以编程方式更改 Spring.net 中的数据库(使用 Ado 模板)?

How to programatically change databases in Spring.net (use AdoTemplate)?

如何以编程方式更改 Spring.net 中的数据库(使用 AdoTemplate)? (Spring.net 还没有 AbstractRoutingDataSource )

看看MultiDelegatingDbProviderhere

MultiDelegatingDbProvider

There are use-cases in which there will need to be a runtime selection of the database to connect to among many possible candidates. This is often the case where the same schema is installed in separate databases for different clients. The MultiDelegatingDbProvider implements the IDbProvider interface and provides an abstraction to the multiple databases and can be used in DAO layer such that the DAO layer is unaware of the switching between databases. MultiDelegatingDbProvider does its job by looking into thread local storage. This storage location stores the name of the dbProvider that is to be used for processing the request.