sql >> Database teknologi >  >> RDS >> Mysql

Vis databaser af MySql-server

string myConnectionString = "SERVER=localhost;UID='root';" + "PASSWORD='root';";
MySqlConnection connection = new MySqlConnection(myConnectionString);
MySqlCommand command = connection.CreateCommand();
command.CommandText = "SHOW DATABASES;";
MySqlDataReader Reader;
connection.Open();
Reader = command.ExecuteReader();
while (Reader.Read())
{
  string row = "";
  for (int i = 0; i < Reader.FieldCount; i++)
       row += Reader.GetValue(i).ToString() + ", ";
       comboBox1.Items.Add(row);
}
connection.Close();


  1. Hvad er bedre - mange små borde eller et stort bord?

  2. Har ikke databaselås! i android

  3. PHP asynkron metodekald i Yii Framework

  4. Problem med utf-8-kodning ved hjælp af PHP + MySQL