Castle.ActiveRecord.Framework.ISessionFactoryHolder sessionFactoryHolder = Castle.ActiveRecord.ActiveRecordMediator.GetSessionFactoryHolder(); NHibernate.ISession _session = sessionFactoryHolder.GetSessionFactory(typeof(ApplyInfo)).GetCurrentSession(); /*可以使用ADO.NET对象了*/ IDbCommand cmd = _session.Connection.CreateCommand(); cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "proc_DeleteApplyInfo";