public void createLogFile(DBinfo dbconnstring)
        {
            string connString = @"server=" + dbconnstring.ServerName + ";userid=root" + ";password=metalic";

            MessageBox.Show(connString);
            cnnLog = new MySqlConnection(connString);
            try
            {
                cnnLog.Open();
                // MessageBox.Show("Connection Open ! ");
                MessageBox.Show("Connection Open!\n", "Connection", MessageBoxButtons.OK, MessageBoxIcon.None);
            }
            catch (MySqlException ex)
            {
                MessageBox.Show("Can not open connection ! \n" + ex.ToString());
                //MessageBox.Show(ex.ToString());
            }
            cmd.Connection  = cnnLog;
            cmd.CommandText = "CREATE DATABASE " + dbconnstring.DBName + "_log";
            cmd.ExecuteNonQuery();
        }
Пример #2
0
 public string getConnectionString(DBinfo dbconnstring)
 {
     //string a = "Data Source=" + dbconnstring.ServerName + ";Initial Catalog=" + dbconnstring.DBName + ";User ID=root" + ";Password=metalic";
     return("Data Source=" + dbconnstring.ServerName + ";Initial Catalog=" + dbconnstring.DBName + ";User ID=root" + ";Password=metalic");
 }