connect to Sybase IQ with NHibernate

不羁岁月 提交于 2019-12-11 16:45:29

问题


I want to connect to a Sybase IQ database, which is lying on a server via Fluent NHibernate: I use C# with the NHibernate version 3.3.1.4

I am using the code from here: http://pwigle.wordpress.com/2008/11/21/nhibernate-session-handling-in-aspnet-the-easy-way/

I have tried to adopt the construktor to this:

private SessionManager()
{
    sessionFactory = Fluently.Configure()
   .Database(SQLAnywhereConfiguration.SQLAnywhere11.ConnectionString("server=SERVER_NAME:PORT; user=USER_NAME; password=PASSWORD; database=DATABASE"))
   .Mappings(m => m.FluentMappings.AddFromAssemblyOf<SessionManager>())
   .ExposeConfiguration(x => x.SetProperty("current_session_context_class", "managed_web"))
   .BuildConfiguration()
   .BuildSessionFactory();
}

I get no connection to my database; does I use the right connection string, or is the SQLAnywhereConfiguration class wrong?


回答1:


You can see http://www.connectionstrings.com/sybase-advantage/ or http://www.connectionstrings.com/sybase-adaptive/ to check your connection string format.



来源:https://stackoverflow.com/questions/17608910/connect-to-sybase-iq-with-nhibernate

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!