需要插入返回last_insert_id() [英] need insert return last_insert_id()

查看:184
本文介绍了需要插入返回last_insert_id()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人

现在,我希望将插入函数添加到具有以下规范的tableadpator中:

1.接受一个参数(一个绑定到数据库的数据表)
2.标量化后才能返回last_insert_id()

如何使用VS2005和Mysql在C#中完成此操作

我尝试了数百万种方法,这些方法带来了数百万种无休止的错误!!

感谢您的帮助

Bye

Dear all

Now i want a insert function to be added to a tableadpator with following specs:

1. take one parameter ( one datatable which is binded to the DB)
2. to be scalar to be able to return last_insert_id()

How this can be done in C# using VS2005 & Mysql

I tried millions of ways which gives millions of endless bugs !!

Thanks for any help

Bye

推荐答案

如果将插入查询放入SP并从该过程返回最新的自动生成的ID,该怎么办.
what if you put your insert query in an SP and return that latest autogenerated id from the procedure.


什么您是否在插入查询中尝试过此操作,以及根据存储过程生成的输出是什么?
What have you tried for this in Insert Query and what is the Output it got Generated based on your Stored Procedure.


final
不使用ODBC并使用.Net连接并在插入查询中添加

;选择last_insert_id()作为``xxx''

xxx您所需的ID名称

再见
final
not to use ODBC and use .Net connect and add in the insert query

; select last_insert_id() as ''xxx''

xxx your required id name

bye


这篇关于需要插入返回last_insert_id()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆