Sorry for what I am sure is bound to be a stupid question but I am
trying to take NHibernate.Spatial for a test drive and am having some
issues getting out of the gate.  I am following the config info
provided at http://www.nhforge.org/wikis/spatial/configuration-and-mapping.aspx
but am clearly doing something incorrectly.

For background I am trying to use NHibernate.Spatial  to access a
table in a SQL 2008 db from an ASP.net MVC (Preview 5) web app.  I am
assuming that I am doing something wrong in my hibernate.cfg.xml
file.  I have provided my config file below for reference.

<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
        <session-factory>
                <property
name="connection.provider">NHibernate.Connection.DriverConnectionProvider</
property>
                <property
name="dialect">NHibernate.Spatial.Dialect.MsSql2008SpatialDialect,NHibernate.Spatial</
property>
                <property
name="connection.driver_class">NHibernate.Driver.SqlClientDriver</
property>
                <property name="connection.connection_string">Data
Source=localhost;Initial Catalog=spatial;Integrated Security=true;</
property>
                <property name="show_sql">true</property>
        </session-factory>
</hibernate-configuration>

There are a couple of things worth note. The documentation indicates
that I should be using <property name="hibernate.dialect" /> and I am
using <property name="dialect"/> instead because using
"hibernate.dialect" seems to violate an enumeration constraint.  Using
the dialect property listed above I get the following error:

System.TypeLoadException: Could not load type
'NHibernate.Spatial.Dialect.MsSql2008SpatialDialect' from assembly
'NHibernate.Spatial, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null'.

I figured I might be barking up the wrong assembly so I also tried the
following dialect property definition.
<property
name="dialect">NHibernate.Spatial.Dialect.MsSql2008SpatialDialect,NHibernate.Spatial.MsSql2008</
property>  With this value I get the following error that appears to
be more promising but is still an error.

System.TypeLoadException: Method 'ToGeometry' in type
'NHibernate.Spatial.Type.MsSql2008GeometryType' from assembly
'NHibernate.Spatial.MsSql2008, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null' does not have an implementation.

Note the change for this second property value is reference to
NHibernate.Spatial.MsSql2008.

I am assuming that I am doing something very stupid but am not sure
what that might be.  Any help in pointing out the error(s) of my way
would be appreciated.

Thanks,

-kp



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to