Take Alias from Mysql

I need take alias from display on dialogbox but Alias not is field,and display error,my code is:

//Secuencia de busqueda del ultimo crear por el vendedor - banca
Dim db as mySQLCommunityServer
db=New mySQLCommunityServer
db.host = “192.168.0.27”
db.port = 3306
db.databaseName = “issadmin”
db.userName=“iss”
db.Password=“iss222222”
Dim sql122 as string = "SELECT MAX(id) AS ido FROM ticketscab where IdVendedor = 2 and Idbanca =2 "
Dim verloticket as Integer
dim rsw2 as RecordSet = db.SQLSelect(sql122)
verloticket = rsw2.Field(“ido”).Value
MsgBox "El Ultimo ticket fue : " + str(verloticket)
//fin secuencia de busqueda ultimo ticket

What is your error?

You should check db.Error and db.ErrorMessage after calling db.SQLSelect to see if you actually get back a RecordSet with data.

Only display NilObjectException in line :

verloticket = rsw2.Field(“ido”).Value

FYI: In order for your image to appear, you’ll have to upload it somewhere. Also, it seems like you deleted your original message which will make it harder for people to help.

If you are getting a NilObjectException on that line, then the SQL likely caused a database error of some kind. Check the two properties I mentioned above to see the error.