Lots of problems with VB.NET and MySQL
Posted by: Erika Garza
Date: February 12, 2005 01:48PM

Hi everyone!, is the first time i use mysql with anything!, so i have a lot of questions about the errors i get!.. i allways have worked with MS SQL, i understand how it works and i consider myself pretty good in it.. but mysql is annoying me all the time.. please help me!

Im trying to insert a record, and i need the @@identity back...
This is the code im trying...

Dim sqlstr As New MySql.Data.MySqlClient.MySqlCommand("INSERT INTO Cliente (vchNombre, vchApellido, vchEmail, dtFechaNacimiento, vchDireccion, vchPais, vchEstado, dtFechaAlta, iCodAgente, iCodigoPostal, iEstatus, iTipoCliente, vchCiudad) " & _
"VALUES (?vchNombre, ?vchApellido, ?vchEmail, ?dtFechaNacimiento, ?vchDireccion, ?vchPais, ?vchEstado, ?dtFechaAlta, ?iCodAgente, ?iCodigoPostal, ?iEstatus, ?iTipoCliente, ?vchCiudad; SELECT @@identity)", SqlConn)

I try the same code, but with real values in MYSQL Query Browser, i get this message: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT @@identity' at line 3" ... IT DOESN'T TELL ME ANYTHIIING!! hehehe
i dont see anything wrong in it... i hope you guys could tell me something...

________________________________
Ing. Erika Garza

"It's a good thing there's more than one way
to do it because most of them don't work."

Options: ReplyQuote


Subject
Written By
Posted
Lots of problems with VB.NET and MySQL
February 12, 2005 01:48PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.