Quantcast
Channel: MySQL Forums - Connector/NET and C#, Mono, .Net
Viewing all articles
Browse latest Browse all 1447

Need Assistance Trying to CREATE a table in VB.Net (1 reply)

$
0
0
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

Viewing all articles
Browse latest Browse all 1447

Trending Articles



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