Wondering if someone could help me with adding parameters to a mysql query with vb.net
Here's my code:
mycmd = New MySqlCommand
'mycmd.Parameters.Add("?result", MySqlType.Text)
mycmd.Parameters(0).Value = "This is a test"
mycmd.Parameters(0).Direction = ParameterDirection.Input
mycmd.CommandText = "Insert into result_holder(result_id, result) Values('45',?result)"
mycmd.Connection = mycon
'Try
mycon.Open()
mycmd.ExecuteNonQuery()
mycon.Close()
Catch ex As Exception
MsgBox(ex.Message)
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
------------------- ----- ---- -- -