MySQL Forums
Forum List  »  MySQL for Visual Studio

Vb.net My Sql Syntax
Posted by: hadinoto surya
Date: April 06, 2017 03:30AM

Hi Friends,

I use MySql 5.7, Net Connector 6.6.7 and Visual Studio Vb Net 2008

I Have error result when executing these code;


modkoneksi.bukaDB()
SIMPAN = "INSERT INTO

GUESTMEMBER(membercode,nama,alamat,vip,birthday,nation,company,specialrate,diskon,segmen,purpose,settledby,limit,idno) " & _
"VALUES(?p1, ?p2, ?p3, ?p4, ?p5, ?p6, ?p7, ?p8, ?p9, ?p10, ?p11, ?p12, ?p13, ?p14)"

CMD = New MySqlCommand(SIMPAN, conn)

CMD.Parameters.AddWithValue("?p1", kodetxt)
CMD.Parameters.AddWithValue("?p2", namatxt)
CMD.Parameters.AddWithValue("?p3", alamattxt)
CMD.Parameters.AddWithValue("?p4", viptxt)
CMD.Parameters.AddWithValue("?p5", tanggallahirtxt)
CMD.Parameters.AddWithValue("?p6", nationalitytxt)
CMD.Parameters.AddWithValue("?p7", perusahaantxt)
CMD.Parameters.AddWithValue("?p8", specialratetxt)
CMD.Parameters.AddWithValue("?p9", diskontxt)
CMD.Parameters.AddWithValue("?p10", segmentxt)
CMD.Parameters.AddWithValue("?p11", purposetxt)
CMD.Parameters.AddWithValue("?p12", settledbytxt)
CMD.Parameters.AddWithValue("?p13", limittxt)
CMD.Parameters.AddWithValue("?p14", idnotxt)


CMD.ExecuteNonQuery()



conn.Dispose()

'CMD.Dispose()
conn.Close()
Tampilgrid()


after execution vb result error as below:


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 'limit,idno) VALUES(_binary 'System.Windows.Forms.TextBox, Text: 1001', _binary '' at line 1

beside '?' ,i have tried also before using '@' for the p variable but same result

What's wrong in my code ,can help me?.Thanks

Options: ReplyQuote


Subject
Views
Written By
Posted
Vb.net My Sql Syntax
353
April 06, 2017 03:30AM
141
April 11, 2017 08:58AM
135
May 09, 2017 01:03AM
112
May 11, 2017 10:27AM


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.