Ejemplo n.º 1
0
 /// <summary>
 /// 选择不同的数据库
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void cbDatabases_SelectionChangeCommitted(object sender, EventArgs e)
 {
     if (isDbChanged)
     {
         if (cbDbType.SelectedIndex == (int)DbType.SqlServer)
         {
             UtilSqlserver.SetDatabase(cbDatabases.SelectedItem.ToString());
         }
         else
         {
             UtilMysql.SetDatabase(cbDatabases.SelectedItem.ToString());
         }
         isDbChanged = false;
         listResult.Clear();
         cbTables.Items.Clear();
         cbTables.Text      = "";
         btnColumns.Enabled = false;
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 选择不同数据库类型
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void cbDbType_SelectionChangeCommitted(object sender, EventArgs e)
 {
     if (isDbTypeChanged)
     {
         cbDatabases.Text = (cbDbType.SelectedIndex == (int)DbType.SqlServer)?UtilSqlserver.Database_Name:UtilMysql.Database_Name;
         if (cbDbType.SelectedIndex == (int)DbType.SqlServer)
         {
             UtilSqlserver.SetDatabase(UtilSqlserver.Database_Name);
             //btnMigrantScript.Enabled = false;
             btnMigrantScript.Text    = "移植数据库脚本[SQLServer->Mysql]";
             btnDropAllTables.Enabled = true;
         }
         else
         {
             UtilMysql.SetDatabase(UtilMysql.Database_Name);
             // btnMigrantScript.Enabled = true;
             btnMigrantScript.Text    = "移植数据库脚本[Mysql->SQLServer]";
             btnDropAllTables.Enabled = false;
         }
         cbDatabases.Text = "";
         isDbTypeChanged  = false;
         listResult.Clear();
     }
 }