Wondering if someone could help me with adding parameters to a mysql query with vb.net
Here's my code:
mycmd = New MySqlCommand
'mycmd.Paramete rs.Add("?result ", MySqlType.Text)
mycmd.Parameter s(0).Value = "This is a test"
mycmd.Parameter s(0).Direction = ParameterDirect ion.Input
mycmd.CommandTe xt = "Insert into result_holder(r esult_id, result) Values('45',?re sult)"
mycmd.Connectio n = mycon
'Try
mycon.Open()
mycmd.ExecuteNo nQuery()
mycon.Close()
Catch ex As Exception
MsgBox(ex.Messa ge)
End Try
I the exception I get is "You have an error in your sql statement near 'result'
What am I doing wrong??
Thanks!
Daniel
--
--------------------------------- --- -- -
Posted with NewsLeecher v3.9 Final
Web @ http://www.newsleecher.com/?usenet
------------------- ----- ---- -- -
Here's my code:
mycmd = New MySqlCommand
'mycmd.Paramete rs.Add("?result ", MySqlType.Text)
mycmd.Parameter s(0).Value = "This is a test"
mycmd.Parameter s(0).Direction = ParameterDirect ion.Input
mycmd.CommandTe xt = "Insert into result_holder(r esult_id, result) Values('45',?re sult)"
mycmd.Connectio n = mycon
'Try
mycon.Open()
mycmd.ExecuteNo nQuery()
mycon.Close()
Catch ex As Exception
MsgBox(ex.Messa ge)
End Try
I the exception I get is "You have an error in your sql statement near 'result'
What am I doing wrong??
Thanks!
Daniel
--
--------------------------------- --- -- -
Posted with NewsLeecher v3.9 Final
Web @ http://www.newsleecher.com/?usenet
------------------- ----- ---- -- -
Comment