Spatial Data types

Posts   
 
    
zee
User
Posts: 35
Joined: 24-Jul-2008
# Posted on: 24-Mar-2009 23:20:32   

Does llblgen generator have support for sql 2008's spatial data types?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 25-Mar-2009 03:51:00   

No. There is no direct support for that. Some guys worked on a modified version of the Oracle driver: http://llblgen.com/tinyforum/Messages.aspx?ThreadID=10840

David Elizondo | LLBLGen Support Team
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39859
Joined: 17-Aug-2003
# Posted on: 25-Mar-2009 10:08:37   

spatial types are UDT CLR types, so require the assembly installed on the local machine to be retrieved (there's no other way to map them to a .NET type as they ARE the .net type). We haven't tested this assembly so it might be the sqlserver 2008 driver doesn't pick them up.

If it does, you can map fields using that type, however they're readonly, you can't save data with CLR types, as the ado.net provider mechanism to specify the .net type is not flexible enough (it requires the info in which catalog/schema the clr type is stored, which is info which isn't available at runtime).

Frans Bouma | Lead developer LLBLGen Pro
zee
User
Posts: 35
Joined: 24-Jul-2008
# Posted on: 27-Mar-2009 19:50:26   

odd behaviour.. i created a table, had a spatial data type., in my sproc, i was doing a select * from sometablewithspatialtype

on my dev machine, this worked with no issues, it ran., returned the table., i never used the spatialtype., but it was there in the datatable..

on my production machine,. a hosted website, discoutnasp... it gave me a DataReader.GetFieldType(...) returned null.

googling that error gave me http://social.technet.microsoft.com/Forums/en-US/sqlnetfx/thread/eae17407-2910-455c-92eb-8c28e5dabbc5/

i tried that,. it didnt help... so... what i did was simple modify my select *., to select ...named columns and excluded the spatial data type...

all my spatial calculatiosn are in sprocs itself., so i never really "set" a geometry or geography data type in code...

not sure why it works on my dev machine but not hosted production.,.. strange?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39859
Joined: 17-Aug-2003
# Posted on: 28-Mar-2009 11:29:13   

I think it can't find the CLR assembly with the spatial type on the hosted machine? From my experience, the CLR UDT assemblies have to be in the GAC otherwise they won't work for client code (so a datareader won't be able to read a value in such a datatype)

Frans Bouma | Lead developer LLBLGen Pro
zee
User
Posts: 35
Joined: 24-Jul-2008
# Posted on: 28-Mar-2009 20:10:50   

Yup, i second that though, they probably do not have it in the GAC...