DataTable.Load does not work, checked with 6.3 and 6.8.1:
[Test]
public async Task check_loading_results_into_DataTable()
{
var cancellationToken = CancellationToken.None;
// using Testcontainers and Testcontainers.ClickHouse packages
await using var clickhouseContainer = new ClickHouseBuilder()
.WithImage("clickhouse/clickhouse-server:23.3-alpine")
.Build();
await clickhouseContainer.StartAsync(cancellationToken);
using var connection = new ClickHouseConnection(clickhouseContainer.GetConnectionString());
await connection.OpenAsync(cancellationToken);
using var command = connection.CreateCommand();
command.CommandText = "SELECT 1 as SOMEID FROM numbers(10)";
await using var reader = await command.ExecuteReaderAsync(cancellationToken);
var table = new DataTable();
table.Load(reader);
}
Expected: DataTable to be filled with the results of the query
Actual: test fails with following error
Message:
System.InvalidCastException : Unable to cast object of type 'System.String' to type 'System.Type'.
DataTable.Load does not work, checked with 6.3 and 6.8.1:
Expected: DataTable to be filled with the results of the query
Actual: test fails with following error