public void ChangeDatabase() { Conn.ChangeDatabase("template1"); var command = new NpgsqlCommand("select current_database()", Conn); var result = (String)command.ExecuteScalar(); Assert.AreEqual("template1", result); }
/// <summary> /// 修改当前连接的数据库 /// 不要用.会出问题. /// </summary> /// <param name="databaseName"></param> public void ChangeDatabase(string databaseName) { Conn.ChangeDatabase(databaseName); }