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

        Return Last ID (IDENTITY) On Insert row VB.NET MySQL(在插入行时返回最后一个 ID (IDENTITY) VB.NET MySQL)
          <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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  System.Data.OracleClient requires Oracle client software version 8.1.7(System.Data.OracleClient 需要 Oracle 客户端软件版本 8.1.7)
                  Oracle Equivalent to MySQL INSERT IGNORE?(Oracle 相当于 MySQL INSERT IGNORE?)
                  How to initialize mysql container when created on Kubernetes?(在 Kubernetes 上创建时如何初始化 mysql 容器?)
                  connecting to a docker-compose mysql container denies access but docker running same image does not(连接到 docker-compose mysql 容器拒绝访问,但运行相同图像的 docker 不会)
                  MYSQL_ROOT_PASSWORD is set but getting quot;Access denied for user #39;root#39;@#39;localhost#39; (using password: YES)quot; in docker container(MYSQL_ROOT_PASSWORD 已设置,但“访问被拒绝用户 root@localhost(使用密码:YES);在码头集装箱) - IT
                  not able to connect to mysql docker from local(无法从本地连接到 mysql docker)
                  <legend id='6nuNo'><style id='6nuNo'><dir id='6nuNo'><q id='6nuNo'></q></dir></style></legend>
                    <tbody id='6nuNo'></tbody>
                  • <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'>