MySql Last Insert ID, Connector .net

后端 未结 6 2108
广开言路
广开言路 2020-12-01 16:22

I\'m using the MySql Connector .net, and I need to get the insert id generated by the last query. Now, I assume the return value of MySqlHelper.ExecuteNonQuery

6条回答
  •  感情败类
    2020-12-01 17:19

    1 is the no of records effected by the query here only one row is inserted so 1 returns

    for getting id of the inserted row you must use scope_identity() in sqlserver and LAST_INSERT_ID() in MySql

提交回复
热议问题