开发者

How do I get the connection string associated with an nHibernate GenericADOException for logging purposes?

开发者 https://www.devze.com 2023-04-08 21:34 出处:网络
I need to log the se开发者_开发知识库rver name from the connection string that was in use when the nHibernate GenericADOException was thrown.

I need to log the se开发者_开发知识库rver name from the connection string that was in use when the nHibernate GenericADOException was thrown.

Anyone know how to do this? I've looked high and low on the web and haven't found anything that looks promising.


Grab the ISession.

ISession session = SessionFactory.OpenSession();
string connectionString = session.Connection.ConnectionString;
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号