///This example shows for Mysql database
/// First the establish the connection in usual manner as follows
Dim Con
Dim Sql
Dim cmd As New MySqlCommand
Sql = "Database=Dbase;server=localhost;User Id=root;Pwd=password"
Try
Con = New MySqlConnection(Sql)
If Con.State = ConnectionState.Closed Then
Con.Open()
///connection is opened successfully Then ?..
/// use your normal SQL commands as you use in your SQL Prompt ?
In the following sql string >>>>
Sql = "CREATE DATABASE IF NOT EXISTS d1base; " & _
"USE d1base; " & _
"DROP TABLE IF EXISTS branch_mast; " & _
"CREATE TABLE branch_mast(" & _
"Br_Code varchar(5) default NULL," & _
"Br_Name varchar(25) default NULL" & _
") ENGINE=InnoDB DEFAULT CHARSET=latin1 ; "
////Run the command CMD here your SQL STATEMENTS or the commands will be executed. >>>>
cmd = New MySqlCommand(Sql, gencon)
cmd.ExecuteNonQuery()
End If
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
GOOD LUCK !!!!!
B. Rathina Kumar
(rathinam@vsnl.net)