none
TableAdaptor.Insert return value and identity index RRS feed

  • Question

  • TableAdaptor.Insert() returns an int. What does that int represent?

     

    Also, when I perform a TableAdaptor.Insert(...) on a table with an identity index, how can I get the index assigned to the row?

    Tuesday, January 15, 2008 1:26 AM

Answers

  •  dbooksta wrote:

    TableAdaptor.Insert() returns an int. What does that int represent?

     

    Also, when I perform a TableAdaptor.Insert(...) on a table with an identity index, how can I get the index assigned to the row?

     

    It returns an integer value from this statement, created by the Form Designer.

     

    Code Block

    int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery();

     

     

    That value is the number of rows affected by the command.

     

    Rudedog

    Tuesday, January 15, 2008 3:24 AM