|
-
Aug 6th, 2003, 09:18 AM
#1
Thread Starter
Fanatic Member
Command Parameters
Can someone tell me why the following code does not work ?
It does not crash or cause errors and it creates a new row in the table "tblusers" but the fields are NULL.
Sub doInsert()
'Create Insert string
Dim MySQL As String = "Insert into tblusers (USERTEXT) values (@Pnotes)"
'Set up connection to mysql database
Dim myConn As OdbcConnection = New OdbcConnection("driver={MySql};uid=root;pwd=;server=127.0.0.1;database=dbnrgplc;OPTION=17923")
Dim Cmd As New OdbcCommand(MySQL, myConn)
Cmd.Parameters.Add(New OdbcParameter("@Pnotes", Me.txtNotes.Text))
myConn.Open()
Cmd.ExecuteNonQuery()
myConn.Close()
End Sub
Thanks in Advance
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|