0
我有以下的單數據庫結構:小巧玲瓏的存儲過程調用正確的數據庫
Server
|
Database
+ Tables
+ Programmability(stored procedures)
在裏面我是用下面的方法採用精緻小巧,使存儲過程調用:
public List<Events> GetEvents()
{
using (var connection = new SqlConnection(SQLSettings.GetConnectionString()))
{
return connection.Query<Events>("GetEvents", commandType: CommandType.StoredProcedure).ToList();
}
}
但現在我正在將後端更改爲多個數據庫結構,如:
Server
|
Database1
+ Tables
+ Programmability(stored procedures)
|
Database2
+ Tables
+ Programmability(stored procedures)
我的問題我s,我如何修改我的方法以確保它正在存儲過程所在的正確數據庫?
哪個DB它使用是基於連接字符串。 – juharr
我覺得這很簡單。感謝所有人的快速回復。 – PixelPaul