Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Simple read-only tabular data structure like a light-weight DataTable
C#
branch: master
Failed to load latest commit information.
src Initial import
.gitignore
LICENSE.txt
README.md

README.md

SimpleDataTable

Sometimes I feel that System.Data.DataTable is too "heavy-weight" for my needs. I just need a simple data structure to keep read-only tabular data in memory, and List<List<object>> might even do.

SimpleDataTable looks similar to DataTable, but is just a glorified List<List<object>>.

Of course if your data is strongly typed then you don't even need this kind of thing and something simpler like List<MyPoco> will work even better.

Example of using SimpleDataTable with an ADO.NET data reader:

SimpleDataTable table = new SimpleDataTable();
using (SqlDataReader reader = cmd.ExecuteReader())
{
    DataReaderAdapter adapter = new DataReaderAdapter();
    adapter.Fill(table, reader);
}
foreach (DataRow row in table.Rows)
{
    Console.WriteLine("{0} {1}", row["id"], row["name"]);
}
Something went wrong with that request. Please try again.