在webconfig上增添
<webadnuke> <database> <add name="SqlDbProvider" type="Commond"> <server>111.11.111.11</server> <database>Ll</database> <userID>sa</userID> <providerName>System.Data.SqlClient</providerName> <passwrod>111111</passwrod> </add> <add name="SqlDWHProvider" type="Commond"> <server>172.20.100.38</server> <database>Ll_DWH</database> <userID>sa</userID> <providerName>System.Data.SqlClient</providerName> <passwrod>1111</passwrod> </add> <add name="defaultDbProvider" type="Commond" Prefix="vmd_test" conString="Server=111.11.111.11;Database=vmd_test;Uid=root;Pwd=111;Charset=utf8"/> </database> </webadnuke>
一般是默认
defaultDbProvider
多个就添加<add></add>
Database db = Database.Instance("SqlDWHProvider");加入name
不填就是默认