mauede
Well-known member
Is there a dynamic memory allocation class in C#?
I have in mind something equivalent to C++ push_back?
The reason is that I am reading an entire column from a database table. I do not know the column length in advance.
It is something that can vary.
I would like to get all the items, I read from a specific column of a database table, placed in a list.
Unluckily the library that C# uses to access PostgreSQL, namely Npgsql, reads one row at a time.
So to get an entire column, whose length is unknown, we have to keep reading until the column end is reached.
Something similar to read a file until EOF is encountered.
May I add consecutively read items to a list in C#?
What is the best strategy in this case?
Thank you in advance
Mauede
I have in mind something equivalent to C++ push_back?
The reason is that I am reading an entire column from a database table. I do not know the column length in advance.
It is something that can vary.
I would like to get all the items, I read from a specific column of a database table, placed in a list.
Unluckily the library that C# uses to access PostgreSQL, namely Npgsql, reads one row at a time.
So to get an entire column, whose length is unknown, we have to keep reading until the column end is reached.
Something similar to read a file until EOF is encountered.
May I add consecutively read items to a list in C#?
What is the best strategy in this case?
Thank you in advance
Mauede