[image: Capture.PNG]
yes i do. i ran  "Create extension postgis" to install postgis to my 
database. But the exception still there


On Monday, October 1, 2018 at 8:16:00 PM UTC+7, saltcode wrote:
>
> the inner exception says it all
>
> Inner Exception 1:
> NpgsqlException: The NpgsqlDbType 'Geometry' isn't present in your 
> database. You may need to install an extension or upgrade to a newer 
> version.
>
> Install the Postgres extension for the database.
>
> On Mon, Oct 1, 2018 at 12:31 PM Đạt Ý Đặng Huỳnh <[email protected] 
> <javascript:>> wrote:
>
>> I am using NHibernate v 5.13, NHibernate.Spatial.Postgis v5.0, Npgsql 
>> v4.0.3 when i try insert a record into my __layer table the application 
>> thrown an exception below.
>>
>>
>> NHibernate.Exceptions.GenericADOException
>>   HResult=0x80131500
>>   Message=could not insert: [Layer][SQL: INSERT INTO __Layer (ServiceId, 
>> Name, XmlMapping, TableName, FilterExpression, State, SpatialReference, 
>> Type, Drawing, VisibleRange, IsEditable, IsVersioned, 
>> SignalRIsAddEventEnabled, SignalRIsUpdateEventEnabled, 
>> SignalRIsDeleteEventEnabled, PubNubIsAddEventEnabled, 
>> PubNubIsUpdateEventEnabled, PubNubIsDeleteEventEnabled, 
>> AzureIsAddEventEnabled, AzuresUpdateEventEnabled, 
>> AzureIsDeleteEventEnabled, IsODataEnabled, HasAttachments, IsSupportTime, 
>> TimeFieldId, MinDate, MaxDate, Extent, PopupType, PopupContent, MinScale, 
>> MaxScale, RelationshipsJson) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 
>> ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); select 
>> lastval()]
>>   Source=BlueSpatial.Core
>>   StackTrace:
>>    at BlueSpatial.ProgressHub.AddLayerFromFile(String filePath, String 
>> tableName, Int32 serviceId, String connectionHubId, Boolean isODataEnabled) 
>> in 
>> D:\Source\WorkSpace\CloudSpatial\BlueSpatial_Dev\BlueSpatial.Core\ProgressHub.cs:line
>>  
>> 50
>>    at 
>> Microsoft.AspNet.SignalR.Hubs.HubMethodDispatcher.<>c__DisplayClass10_0.<WrapVoidAction>b__0(IHub
>>  
>> hub, Object[] parameters)
>>    at 
>> Microsoft.AspNet.SignalR.Hubs.HubDispatcher.Incoming(IHubIncomingInvokerContext
>>  
>> context)
>>
>> Inner Exception 1:
>> NpgsqlException: The NpgsqlDbType 'Geometry' isn't present in your 
>> database. You may need to install an extension or upgrade to a newer 
>> version.
>>  
>>
>> My mapping for extend collumn using gemetry like this.
>>
>>     <property name="Extent" type="NHibernate.Spatial.Type.GeometryType, 
>> NHibernate.Spatial">
>>       <column name="Extent" sql-type="geometry" not-null="true" />
>>
>>
>> Here is actual sql query
>>
>>   INSERT 
>>     INTO
>>         __Layer
>>         (ServiceId, Name, XmlMapping, TableName, FilterExpression, State, 
>> SpatialReference, Type, Drawing, VisibleRange, IsEditable, IsVersioned, 
>> SignalRIsAddEventEnabled, SignalRIsUpdateEventEnabled, 
>> SignalRIsDeleteEventEnabled, PubNubIsAddEventEnabled, 
>> PubNubIsUpdateEventEnabled, PubNubIsDeleteEventEnabled, 
>> AzureIsAddEventEnabled, AzuresUpdateEventEnabled, 
>> AzureIsDeleteEventEnabled, IsODataEnabled, HasAttachments, IsSupportTime, 
>> TimeFieldId, MinDate, MaxDate, Extent, PopupType, PopupContent, MinScale, 
>> MaxScale, RelationshipsJson) 
>>     VALUES
>>         (:p0, :p1, :p2, :p3, :p4, :p5, :p6, :p7, :p8, :p9, :p10, :p11, 
>> :p12, :p13, :p14, :p15, :p16, :p17, :p18, :p19, :p20, :p21, :p22, :p23, 
>> :p24, :p25, :p26, :p27, :p28, :p29, :p30, :p31, :p32);
>>     select
>>         lastval();
>>     :p0 = 2 [Type: Int32 (0:0:0)],
>>     :p1 = '1' [Type: String (0:0:0)],
>>     :p2 = '<?xml version="1.0" encoding="utf-8"?>
>> <hibernate-mapping assembly="" namespace="" 
>> xmlns="urn:nhibernate-mapping-2.2">
>>   <class entity-name="1" table="`1_181001145753`" lazy="true" >
>>     <id name="FID" column="`FID`" type="Int32">
>>       <generator class="hilo" />
>>     </id>
>>     <property name="OBJECTID" type="Int32">
>>       <column name="`OBJECTID`" sql-type="Int" not-null="false" />
>>     </property>
>>     <property name="AIRPORT_CO" type="String">
>>       <column name="`AIRPORT_CO`" sql-type="text" not-null="false" />
>>     </property>
>>     <property name="Shape_Leng" type="Single">
>>       <column name="`Shape_Leng`" sql-type="Real" not-null="false" />
>>     </property>
>>     <property name="Shape_Area" type="Single">
>>       <column name="`Shape_Area`" sql-type="Real" not-null="false" />
>>     </property>
>>     <property name="AIRPORT_NA" type="String">
>>       <column name="`AIRPORT_NA`" sql-type="text" not-null="false" />
>>     </property>
>>     <property name="Geom" type="NHibernate.Spa...' [Type: String (0:0:0)],
>>     :p3 = NULL [Type: String (0:0:0)],
>>     :p4 = NULL [Type: String (0:0:0)],
>>     :p5 = 0 [Type: Int32 (0:0:0)],
>>     :p6 = NULL [Type: Int32 (0:0:0)],
>>     :p7 = NULL [Type: Int32 (0:0:0)],
>>     :p8 = NULL [Type: String (0:0:0)],
>>     :p9 = 0 [Type: Int32 (0:0:0)],
>>     :p10 = True [Type: Boolean (0:0:0)],
>>     :p11 = False [Type: Boolean (0:0:0)],
>>     :p12 = False [Type: Boolean (0:0:0)],
>>     :p13 = False [Type: Boolean (0:0:0)],
>>     :p14 = False [Type: Boolean (0:0:0)],
>>     :p15 = NULL [Type: Boolean (0:0:0)],
>>     :p16 = NULL [Type: Boolean (0:0:0)],
>>     :p17 = NULL [Type: Boolean (0:0:0)],
>>     :p18 = NULL [Type: Boolean (0:0:0)],
>>     :p19 = NULL [Type: Boolean (0:0:0)],
>>     :p20 = NULL [Type: Boolean (0:0:0)],
>>     :p21 = False [Type: Boolean (0:0:0)],
>>     :p22 = False [Type: Boolean (0:0:0)],
>>     :p23 = False [Type: Boolean (0:0:0)],
>>     :p24 = NULL [Type: Int32 (0:0:0)],
>>     :p25 = NULL [Type: Single (0:0:0)],
>>     :p26 = NULL [Type: Single (0:0:0)],
>>     :p27 = 
>> 0x010400002000000000020000000101000020000000000000000000000000000000000000000001010000200000000000000000000000000000000000000000
>>  
>> [Type: Object (0:0:0)],
>>     :p28 = NULL [Type: Int32 (0:0:0)],
>>     :p29 = NULL [Type: String (0:0:0)],
>>     :p30 = NULL [Type: Int32 (0:0:0)],
>>     :p31 = NULL [Type: Int32 (0:0:0)],
>>     :p32 = NULL [Type: String (0:0:0)]
>>
>>
>> Please help me. Thanks you
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "nhusers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/nhusers.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> -- 
> Best Regards
> Apatira Lookman
> +2348028400104
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to