cpopham Posted June 25, 2005 Posted June 25, 2005 (edited) Create MySQL database using vb .net {RESOLVED} Is there anyway to create a MySql database on an active server using a .net data provider? I have seen ways of creating a database using MS SQL server and Vb .net, but I am not sure if the same is possible using MySql and Vb .Net. Anyone hve any ideas? Thanks, Chester Edited June 25, 2005 by cpopham Quote ____________________________________________ http://www.pophamcafe.com I am starting a developers section, more tutorials than anything.
cpopham Posted June 25, 2005 Author Posted June 25, 2005 If anyone is curious, is actually simple to create a new database on a myql server. You must have the right user privelges and then the code is as faollows. yConStr = "Data Source=192.168.2.2;User Id=Admin;Pwd=my1;" Dim myConnection As New MySqlConnection(myConStr) Dim myNewDB As String = "CREATE DATABASE menagerie;" 'The following will DROP the database 'Dim mynewdb As String = "DROP DATABASE menagerie;" Dim myComm As New MySqlCommand(myNewDB) myComm.Connection = myConnection Try myConnection.Open() myComm.ExecuteNonQuery() Catch ex As Exception MessageBox.Show(ex.Message) End Try Chester Quote ____________________________________________ http://www.pophamcafe.com I am starting a developers section, more tutorials than anything.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.