Need Assistance Trying to CREATE a table in VB.Net
Posted by: Bob Anonymous
Date: August 02, 2014 10:59PM

Hi,

I am using this little bit of code and trying to create a MySQL table:

Dim MySqlConn As New MySqlConnection( _
"data source=localhost; database=********; user id=root; password=********")
Dim MySqlCmd As MySqlCommand

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

Try
MySqlConn.Open()
MySqlCmd = New MySqlCommand("USE ********;", MySqlConn)
MySqlCmd = New MySqlCommand("CREATE TABLE whatever (id INT(6) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id));", MySqlConn)
'MySqlCmd = New MySqlCommand(
Catch ex As Exception
MsgBox(ex.ToString)
End Try

Debugger.Break()

The Catch block is never entered. And in the Debugger MySqlConn looks OK (to me!). connectionState and State are both Open{1}. But on the other hand I cannot find Settings.Port (3306) in the WorkBench Client Connections. However, the last entry in the "Server Logs" does contain that port number. So I am not certain that my app is even connected. But I am certain that the table I am trying to create does not show up in the WorkBench.

What do you think? Is the app not getting connected at all or is there something wrong with my CREATE TABLE?

I'll appreciate any help you can offer. Thanks, Bob

Options: ReplyQuote


Subject
Written By
Posted
Need Assistance Trying to CREATE a table in VB.Net
August 02, 2014 10:59PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.