OdbcDataAdapter Insert Command

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • monteiro
    New Member
    • Feb 2008
    • 5

    OdbcDataAdapter Insert Command

    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


    Code:
    string selectCommand = "SELECT ROAD_ID, PONTOS  FROM geom";
    OdbcDataAdapter adapter = new OdbcDataAdapter(selectCommand, connection);
    adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey;
    try
       {
          adapter.InsertCommand = new OdbcCommand("INSERT INTO geom (ROAD_ID,PONTOS) " + "VALUES (4,GeomFromText('POINT(2000 243118 191108)',-1));");
    }
    ......
    Last edited by eWish; Mar 15 '08, 01:24 AM. Reason: Please use code tags for data as well
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Are you getting any error from the code ?

    What is GeomFromText('P OINT in your code ?

    Comment

    • monteiro
      New Member
      • Feb 2008
      • 5

      #3
      Originally posted by debasisdas
      Are you getting any error from the code ?
      What is GeomFromText('P OINT 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.

      Comment

      Working...