Hibernate version: Runtime v2.0.50727 /Version 1.2.0.4000
Mapping documents:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
namespace="Ingenix.HCRM.Framework.BE"
assembly="Misc">
<class name="Case" table="CM_Cases">
<id name="CaseID">
<generator class="assigned" />
</id>
<property name="CaseGroupID"/>
<property name="CaseDesc"/>
<property name="CaseDate" type="DateTime"/>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
public ISession OpenSession()
{
ISessionFactory factory;
Configure();
factory = config.BuildSessionFactory();
return factory.OpenSession();
}
private void Configure()
{
config = new Configuration();
IDictionary props = new Hashtable();
props["hibernate.connection.provider"] = "NHibernate.Connection.DriverConnectionProvider";
props["hibernate.dialect"] = "NHibernate.Dialect.MsSql2005Dialect, NHibernate.with2005Dialect";
props["hibernate.connection.driver_class"] = "NHibernate.Driver.SqlClientDriver";
props["hibernate.connection.connection_string"] = "Server=PCID12761;initial catalog=Northwind;User Id=sa;Password=password;";
foreach (DictionaryEntry de in props)
{
config.SetProperty(de.Key.ToString(), de.Value.ToString());
}
Assembly assembly = Assembly.Load(MappingsAssembly);
foreach (string file in MappingFiles)
{
config.AddResource(MappingsAssembly + "." + file, assembly);
}
}
Full stack trace of any exception that occurs:
Inner Exception : {"Could not load file or assembly 'NHibernate.with2005Dialect' or one of its dependencies. The system cannot find the file specified.":"NHibernate.with2005Dialect"}
Message: "Could not instantiate dialect class NHibernate.Dialect.MsSql2005Dialect, NHibernate.with2005Dialect"
StackTrace:" at NHibernate.Dialect.Dialect.InstantiateDialect(String dialectName)\r\n at NHibernate.Dialect.Dialect.GetDialect(IDictionary props)\r\n at NHibernate.Cfg.Configuration.AddValidatedDocument(XmlDocument doc, String name)"
StackTrace: " at NHibernate.Cfg.Configuration.LogAndThrow(MappingException me)\r\n at NHibernate.Cfg.Configuration.AddValidatedDocument(XmlDocument doc, String name)\r\n at NHibernate.Cfg.Configuration.AddXmlReader(XmlTextReader hbmReader, String name)\r\n at NHibernate.Cfg.Configuration.AddInputStream(Stream xmlInputStream, String name)\r\n at NHibernate.Cfg.Configuration.AddResource(String path, Assembly assembly)\r\n at Ingenix.HCRM.Framework.ObjectManager.Configure() in D:\\Sudhagar\\Misc\\ObjectManager.cs:line 62\r\n at Ingenix.HCRM.Framework.ObjectManager.OpenSession() in D:\\Sudhagar\\Misc\\ObjectManager.cs:line 70\r\n at Ingenix.HCRM.Framework.DAL.CaseFactory..ctor() in D:\\Sudhagar\\Misc\\CaseFactory.cs:line 55\r\n at Misc.Form1.button1_Click(Object sender, EventArgs e) in D:\\Sudhagar\\Misc\\Form1.cs:line 25\r\n at System.Windows.Forms.Control.OnClick(EventArgs e)\r\n at System.Windows.Forms.Button.OnClick(EventArgs e)\r\n at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)\r\n at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)\r\n at System.Windows.Forms.Control.WndProc(Message& m)\r\n at System.Windows.Forms.ButtonBase.WndProc(Message& m)\r\n at System.Windows.Forms.Button.WndProc(Message& m)\r\n at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)\r\n at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)\r\n at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)\r\n at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)\r\n at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)\r\n at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)\r\n at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)\r\n at System.Windows.Forms.Application.Run(Form mainForm)\r\n at Misc.Program.Main() in D:\\Sudhagar\\Misc\\Program.cs:line 17\r\n at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)\r\n at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)\r\n at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()\r\n at System.Threading.ThreadHelper.ThreadStart_Context(Object state)\r\n at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n at System.Threading.ThreadHelper.ThreadStart()"
Name and version of the database you are using:
SQL2005
The generated SQL (show_sql=true):
Hi these are the enough information i have captured .
Really thank you all for your time and consideration.
Cheers
Sudhagar.S
|