Lots of problems with VB.NET and MySQL
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."