GHSpro多資料庫連線

2022-01-11 20:22:00 字數 1005 閱讀 9703

文章

name="basedb"

connectionstring="data source=@ip,@埠號;initial catalog=agiledevelope;user id=使用者名稱;pwd=@密碼;integrated security=false;multipleactiveresultsets=true;enlist=true;pooling=true;max pool size=512;min pool size=0;connection lifetime=300;packet size=1000"

providername="system.data.sqlclient" />

name="commondb"

connectionstring="data source=@ip,@埠號;initial catalog=agiledevelope;user id=使用者名稱;pwd=@密碼;integrated security=false;multipleactiveresultsets=true;enlist=true;pooling=true;max pool size=512;min pool size=0;connection lifetime=300;packet size=1000"

providername="system.data.sqlclient" />

connectionstrings>

資料工廠、倉庫介面、倉庫、倉庫工廠和倉庫工廠泛型貌似不用修改,需要修改的服務中心的引用

只需要修改乙個地方就可以

return

this.baserepository("commondb").findentity(keyvalue);

//其他需要用到的地方,都加上乙個引數就可以了。

其他需要用到的地方,都加上乙個引數就可以了。

只能說太給力了。

我愛資料倉儲工廠。

初步體會到介面的好處。誰說工廠模型沒有用啊。簡直愛死他了。

GHSpro多資料庫連線

文章 name basedb connectionstring data source ip,埠號 initial catalog agiledevelope user id 使用者名稱 pwd 密碼 integrated security false multipleactiveresultset...

thinkphp連線多資料庫

在資料庫檔案中設定一下內容 return array 資料庫配置資訊 預設連線這乙個 db type mysql 資料庫型別 db host 127.0.0.1 伺服器位址 db name test1 資料庫名 db user root 使用者名稱 db pwd 密碼 db port 3306,埠 ...

thinkphp連線多資料庫

thinkphp連線多資料庫 配置檔案中 return array 資料庫配置資訊 預設連線這乙個 db type mysql 資料庫型別 db host 127.0.0.1 伺服器位址 db name test1 資料庫名 db user root 使用者名稱 db pwd 密碼 db port ...