This project is read-only.

intellisense and dataypes

Topics: User Forum
Dec 5, 2006 at 2:38 PM
In c# including npgsql.dll gives NpgsqlTypes namespace which has intellisense for all postgis types. Is there a .dll to include for intellisense on types?

In postgres when picking datatype for column it shows types such as polygon, how do see these same types when making column in sqlserver? It only show me system datatypes.
Dec 7, 2006 at 8:28 PM
Im full of questions. In postgis there is a addgeometrycolumn function to add tables. How do I add tables or access datatypes in mssqlspatial?
thanks
Dec 19, 2006 at 9:07 PM
> In postgres (Npgsql) when picking datatype
> for column it shows types such as polygon,
> how do see these same types when making
> column in sqlserver? It only show me system
> datatypes.

"polygon" and other datatypes are native PostgreSQL datatypes. But don't confuse them with the generic "geometry" PostGIS datatype. In fact, native geometry types and PostGIS geometry type are incompatible.

Using System.Data.SqlClient, the "intellisense way" to get a MsSqlSpatial geometry is SqlDbType.VarBinary and ST.AsBinary function in the query. Then you have to use a WKB parser (eg. SharpMap or NetTopologySuite).


> How do I add tables or access datatypes in mssqlspatial?

EXECUTE ST.AddGeometryColumn <schema_name>, <table_name>, <column_name>, <srid>, <type>
For example:
EXECUTE ST.AddGeometryColumn 'dbo', 'polygons', 'the_polygon', -1, 'POLYGON'

Best regards,
Ricardo Stuven.