MySQL Forums
Forum List  »  MySQL for Visual Studio

Re: Get ID after INSERT via MySqlDataAdapter
Posted by: JOSE RAMIREZ
Date: July 11, 2017 09:09AM

Hello Max,

when inserting one row at a time, using LAST_INSERT_ID() as in "SELECT LAST_INSERT_ID()" will retrieve the wanted id. For multiple rows, it might be useful to know that the "MySqlDataAdapter.Update()" method returns the number of affected rows which can later be used with a SELECT statement to get the ids.

I recommend posting this question in the MySQL Connector/NET forum where you can get additional information on how to solve your problem.


Regards.



====================================
Jose Maria Ramirez
MySQL Windows Experience Team

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Get ID after INSERT via MySqlDataAdapter
81
July 11, 2017 09:09AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.