问题
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