您可以使用双重查询并使用函数LAST_INSERT_ID()在运行第一个查询以获取最新的当前查询之后:
Dim insert_coupon_query As String = ("INSERT INTO qa_discountcoupons (status_pre) 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)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)