Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27514

VS 2012 Mysql insert statement not working

$
0
0
As usual, i suck when it comes to sql statements, and once again, i have a problem i am hoping i can get fixed. I know in php the statement is like so:
Code:

"INSERT INTO 'mydatabasename'.'zeds' (@guid);", MysqlConn
but whats the the right syntax for this in vb.net?

Code:

MysqlConn = New MySqlConnection()
            MysqlConn.ConnectionString = "server=#; user id=#; password=#; database=#" 'Hashed out for the post
                MysqlConn.Open()
                'Add sql commands
                Dim cmd As New MySqlCommand("INSERT INTO  'zeds' (@guid);", MysqlConn)'
                cmd.Parameters.AddWithValue("@guid", GuidTextBox.Text)
                'MsgBox(SelItem & " Was Imported")
                cmd.ExecuteNonQuery()
                MysqlConn.Close()

I want to insert this statement under these in the screenshot:

Name:  Screenshot_3.png
Views: 25
Size:  12.7 KB

And this is the table i want to write the guid in to:

Name:  Screenshot_4.png
Views: 2
Size:  38.7 KB

zeds is the database table. To be clear, i wanted to insert each as a new row, like GuidTextBox.Text under JoeBlogs

Can someone tell me how I should be writing this please?
Attached Images
  

Viewing all articles
Browse latest Browse all 27514

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>