Error in Mysql Command.
Revision 2
whenever i use a word with apostrophe like it's , it generate's " a error in mysql command check your manual ".
because as we use '"& texbox.text &"' in mysql commmand . so as we type something like this it input as 'its's' and generate error , so any solution . Waiting ........
for Better Understanding.
Dim cn As New MySqlConnection
Dim cd As MySqlCommand
Dim s As String
cn.ConnectionString = "server=localhost; user id=root; password=; database=dc"
cn.Open()
s = " insert into table_name(column1,column2,..column_n) values('"& textbox1.text&"')"
cd = New MySqlCommand(s, cn)
cd.ExecuteNonQuery()
cn.Close()
Posted 17-Jan-13 0:20am
by
Narendra Singh Rathore.