OleDbCommand Execute result? RRS feed

  • Question

  • Dear community,

    I have a question regarding query on an OleDb connected Access databse.

    I'm generating a INSERT command as string myself, without the PrimaryKey, and then I execute it using ExecuteNonQuery().

    Problem is, I need to know which PrimaryKey was assigned by the database to my new entry, therefore I need to know if it is possible to receive the result of my INSERT query.

    I tried different providers, ExecuteScalar() or ExecuteReader(), but I guess they only provide data for SELECT queries.

    I hope someonone knows a method, to avoid using stupid GUIDs, just for finding my entry again.




    Thursday, January 6, 2011 4:27 PM


All replies