Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NpgsqlConnection conn = new NpgsqlConnection();
- conn.ConnectionString = "Server = localhost;Port = 5432;User Id=USERNAME;Password=PASSWORD;Database=postgres;CommandTimeout=1800000;Pooling=false;Timeout=1024;";
- conn.Open();
- NpgsqlDataReader dataset = new NpgsqlCommand("select datname from pg_database where not datistemplate", conn).ExecuteReader();
- while (dataset.Read())
- {
- comboBox1.Items.Add(dataset.GetString(0));
- }
- dataset.Close();
- dataset.Dispose();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement