Integration Your Way - (800) 235-7250
RSSBus ADO.NET Provider for Amazon SimpleDB
Questions / Feedback? INSERT Statements

INSERT Statements

To insert into a table, use the standard INSERT SQL syntax.

In order to retrieve the ID of the last inserted record, use the GetLastResult hashtable, which is a part of the SimpleDBConnection object.

C#

  String connectionString = "Access Key=My Amazon Access Key;Secret Key=My Amazon Secret Key;Offline=false;";
  using (SimpleDBConnection connection = new SimpleDBConnection(connectionString)) {
    SimpleDBCommand cmd = new SimpleDBCommand("INSERT INTO Lead (FullName) VALUES ('The Joker')", connection);
    cmd.ExecuteNonQuery();
  
    Hashtable result = connection.GetLastResult();
    String Id = result["id"];
  }

VB.NET

  Dim connectionString As [String] = "Access Key=My Amazon Access Key;Secret Key=My Amazon Secret Key;Offline=false;"
  Using connection As New SimpleDBConnection(connectionString)
    Dim cmd As New SimpleDBCommand("INSERT INTO Lead (FullName) VALUES ('The Joker')", connection)
    cmd.ExecuteNonQuery()

    Dim result As Hashtable = connection.GetLastResult()
    Dim Id As [String] = result("id")
  End Using


 
Copyright © 2013 RSSBus Inc.
[x] close

Questions / Feedback?


Name:
Email:
Feedback:
Send Feedback