VB.Net program to create a table in MySql database dynamically
'VB.NET program to create a table in
'MySql database dynamically.
Imports MySql.Data.MySqlClient
Module Module1
Sub Main()
Dim connString As String
'Connection String to connect with MySQL database.
connString = "server=localhost;userid=root;password=root;database=sampledb"
Dim conn As New MySqlConnection(connString)
conn.Open()
Dim cmd As New MySqlCommand("create table employee (eid int, ename varchar(16), salary int) ", conn)
cmd.ExecuteNonQuery()
Console.WriteLine("Table employee created successfully")
conn.Close()
End Sub
End Module
Table employee created successfully
Press any key to continue . . .
Table of Contents