Spatial datatype and assembly

Posts   
 
    
morten71
User
Posts: 80
Joined: 13-Jan-2009
# Posted on: 29-May-2014 23:57:36   

I'm adding spatial data columns to tables I use in a llblgen project.

Compiling the datalayer code (LLBLGen Pro Runtime Framework, in 4.1 may 16th 2014) I'm getting the following error for all geography data type columns:

The type or namespace name 'Types' does not exist in the namespace 'Microsoft.SqlServer' (are you missing an assembly reference?)

The error refer to the following code in the XxxEntity.cs file:

... /// <summary> The Shape property of the Entity Country<br/><br/></summary> /// <remarks>Mapped on table field: "Country"."Shape"<br/> /// Table field type characteristics (type, precision, scale, length): Udt, 0, 0, 0<br/> /// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks> public virtual Microsoft.SqlServer.Types.SqlGeography Shape { get { return (Microsoft.SqlServer.Types.SqlGeography)GetValue((int)CountryFieldIndex.Shape, true); } set { SetValue((int)CountryFieldIndex.Shape, value, true); } } ...

What assembly do I need to reference in my project?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 30-May-2014 07:54:34   

You need Microsoft.SqlServer.Types.dll (ref...).

David Elizondo | LLBLGen Support Team
morten71
User
Posts: 80
Joined: 13-Jan-2009
# Posted on: 31-May-2014 07:49:38   

daelmo wrote:

You need Microsoft.SqlServer.Types.dll (ref...).

thanks.

I found the Microsoft.SqlServer.Types.dll had been installed during the sql 2012 installation into the directory C:\Windows\assembly\GAC_MSIL\Microsoft.SqlServer.Types

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 31-May-2014 15:07:42   

That's the one. You can also pull it from nuget nowadays. You need to reference it in the projects where the types are used.

Frans Bouma | Lead developer LLBLGen Pro