Scope Identity with MySQL table adapter
Posted on 2008-06-12
I am having an issue witha table adapter and the scope identity when using a MySQL database.
If I was creating an Insert statement in a tableadapter to a MSSQL I woudl simply do a
Select Scope_Identity()...so that in teh TableAdapater the insert reads
INSERT INTO [tblApplicationType] ([ApplicationType], [Active]) VALUES (@ApplicationType, @Active);
with a Scalar execution mode and the Insert woudl return the value of teh primary key for that new inserted row...
However adding the
to an insert statement when the table adapater is poitning to a MySQL table returns an error about incorrect syntax.
I need to return the value of the inserted row and capture it..Can someone tell me the correct syntax I need?
I have tried
INSERT INTO tblapplicationtype
VALUES (@ApplicationType, @Active)
But that isnt working...returns and error trying to parse the query.
I am using the MySQL connector 5.2.2