1. <tfoot id='h1y8D'></tfoot>
    2. <legend id='h1y8D'><style id='h1y8D'><dir id='h1y8D'><q id='h1y8D'></q></dir></style></legend>

    3. <i id='h1y8D'><tr id='h1y8D'><dt id='h1y8D'><q id='h1y8D'><span id='h1y8D'><b id='h1y8D'><form id='h1y8D'><ins id='h1y8D'></ins><ul id='h1y8D'></ul><sub id='h1y8D'></sub></form><legend id='h1y8D'></legend><bdo id='h1y8D'><pre id='h1y8D'><center id='h1y8D'></center></pre></bdo></b><th id='h1y8D'></th></span></q></dt></tr></i><div id='h1y8D'><tfoot id='h1y8D'></tfoot><dl id='h1y8D'><fieldset id='h1y8D'></fieldset></dl></div>
        <bdo id='h1y8D'></bdo><ul id='h1y8D'></ul>

      <small id='h1y8D'></small><noframes id='h1y8D'>

        在插入行时返回最后一个 ID (IDENTITY) VB.NET MySQL

        时间:2023-09-17
          <tfoot id='Qd7I4'></tfoot>

        1. <i id='Qd7I4'><tr id='Qd7I4'><dt id='Qd7I4'><q id='Qd7I4'><span id='Qd7I4'><b id='Qd7I4'><form id='Qd7I4'><ins id='Qd7I4'></ins><ul id='Qd7I4'></ul><sub id='Qd7I4'></sub></form><legend id='Qd7I4'></legend><bdo id='Qd7I4'><pre id='Qd7I4'><center id='Qd7I4'></center></pre></bdo></b><th id='Qd7I4'></th></span></q></dt></tr></i><div id='Qd7I4'><tfoot id='Qd7I4'></tfoot><dl id='Qd7I4'><fieldset id='Qd7I4'></fieldset></dl></div>
              <bdo id='Qd7I4'></bdo><ul id='Qd7I4'></ul>
                <tbody id='Qd7I4'></tbody>

                  <small id='Qd7I4'></small><noframes id='Qd7I4'>

                  <legend id='Qd7I4'><style id='Qd7I4'><dir id='Qd7I4'><q id='Qd7I4'></q></dir></style></legend>
                  本文介绍了在插入行时返回最后一个 ID (IDENTITY) VB.NET MySQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  Dim insert_coupon_query As String = ("INSERT INTO qa_discountcoupons (id, status_code) VALUES (AUTO_INCREMENT_ID, 5)")
                                  Dim cmd_query As New MySqlCommand(insert_coupon_query, objConn)
                                  Dim cmd_result As Integer = CInt(cmd_query.ExecuteScalar())
                  

                  我想返回当前插入的 AUTO_INCREMENT 值,并显示在 msgbox 中.

                  I want to return the AUTO_INCREMENT value of the current insert, and show in a msgbox.

                  推荐答案

                  您可以使用双查询并使用函数 LAST_INSERT_ID() 运行您的第一个查询以获取最后一个当前查询后:

                  You can use an double Query and use the function LAST_INSERT_ID() After run your first query to get the last current query:

                  Dim insert_coupon_query As String = ("INSERT INTO qa_discountcoupons (status_code) VALUES (5); SELECT LAST_INSERT_ID()")
                                  Dim cmd_query As New MySqlCommand(insert_coupon_query, objConn)
                                  Dim cmd_result As Integer = CInt(cmd_query.ExecuteScalar())
                  
                                  MsgBox(cmd_result)
                  

                  这篇关于在插入行时返回最后一个 ID (IDENTITY) VB.NET MySQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:SQLite 没有正确存储小数 下一篇:如何检查 DataReader 值是否为空?

                  相关文章

                  <legend id='6nuNo'><style id='6nuNo'><dir id='6nuNo'><q id='6nuNo'></q></dir></style></legend>
                  • <bdo id='6nuNo'></bdo><ul id='6nuNo'></ul>

                  <tfoot id='6nuNo'></tfoot>
                  <i id='6nuNo'><tr id='6nuNo'><dt id='6nuNo'><q id='6nuNo'><span id='6nuNo'><b id='6nuNo'><form id='6nuNo'><ins id='6nuNo'></ins><ul id='6nuNo'></ul><sub id='6nuNo'></sub></form><legend id='6nuNo'></legend><bdo id='6nuNo'><pre id='6nuNo'><center id='6nuNo'></center></pre></bdo></b><th id='6nuNo'></th></span></q></dt></tr></i><div id='6nuNo'><tfoot id='6nuNo'></tfoot><dl id='6nuNo'><fieldset id='6nuNo'></fieldset></dl></div>

                  1. <small id='6nuNo'></small><noframes id='6nuNo'>