Connecting Tech Pros Worldwide Help | Site Map

OdbcDataAdapter Insert Command

Newbie
 
Join Date: Feb 2008
Posts: 5
#1: Mar 14 '08
Hi,
I am using OdbcDataAdapter to insert data to postgreeSQL..
Everything’s seems to be fine, but nothing is inserting in the database. Andy Idea??
Thanks in advance


Expand|Select|Wrap|Line Numbers
  1. string selectCommand = "SELECT ROAD_ID, PONTOS  FROM geom";
  2. OdbcDataAdapter adapter = new OdbcDataAdapter(selectCommand, connection);
  3. adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey;
  4. try
  5.    {
  6.       adapter.InsertCommand = new OdbcCommand("INSERT INTO geom (ROAD_ID,PONTOS) " + "VALUES (4,GeomFromText('POINT(2000 243118 191108)',-1));");
......
debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 7,500
#2: Mar 18 '08

re: OdbcDataAdapter Insert Command


Are you getting any error from the code ?

What is GeomFromText('POINT in your code ?
Newbie
 
Join Date: Feb 2008
Posts: 5
#3: Mar 28 '08

re: OdbcDataAdapter Insert Command


Quote:

Originally Posted by debasisdas

Are you getting any error from the code ?
What is GeomFromText('POINT in your code ?

No i don´t receive any error.
GeomFromText is used to convert a Spatial reference system, version of a geometry into a PostGIS geometry.
Reply