[gdal-dev] Ogr to access MSSQL DB

Tamas Szekeres szekerest at gmail.com
Wed Jul 11 04:04:08 PDT 2012


Benjamin,

What is the content of the geometry_columns metadata table in your database?

Best regards,

Tamas



2012/7/11 Benjamin <benjamin.lux at maxsea.fr>

> Hi, I try to connect my application to a DB with the framework Ogr (with
> C# warper). When I write folloing code, Ogr methods view the DB but can't
> read it. [code] Ogr.RegisterAll(); const string connectionString =
> @"Server=SERVEUR_NAME;Database=DATABASE_NAME;trusted_connection=yes";
> DataSource pnn3 = Ogr.Open("MSSQL:" + connectionString, 0); if (pnn3 ==
> null) throw new IOException("Creation of output file failed.");
> Console.WriteLine("pnn3.Name\t=" + pnn3.name);
> Console.WriteLine("pnn3.GetLayerCount()\t= " + pnn3.GetLayerCount());
> [/code] It display : [quote]
> Server=SERVEUR_NAME;Database=DATABASE_NAME;trusted_connection=yes 0
> [/quote] I know my DB is view because if I switch SERVEUR_NAME and/or
> DATABASE_NAME by an other name the exception is throwed On the other hand
> driver don't see my layers (it displays 0, and my db has near to 30
> layers). If someone have already connected to db MSSQL, can him suggests me
> an example of code (in C or C++ it is also great, it may help me) ? Notes:
> I use gdal-1.9.0 (with MSSQL Driver) link usefull : MSSQLSpatial -
> Microsoft SQL Server Spatial Database<http://www.gdal.org/ogr/drv_mssqlspatial.html>Best regards, Benjamin.
> ------------------------------
> View this message in context: [gdal-dev] Ogr to access MSSQL DB<http://osgeo-org.1560.n6.nabble.com/gdal-dev-Ogr-to-access-MSSQL-DB-tp4987592.html>
> Sent from the GDAL - Dev mailing list archive<http://osgeo-org.1560.n6.nabble.com/GDAL-Dev-f3742093.html>at Nabble.com.
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20120711/be5b3e05/attachment.html>


More information about the gdal-dev mailing list