Skip to content

Simple read-only tabular data structure like a light-weight DataTable

License

Notifications You must be signed in to change notification settings

glombard/SimpleDataTable

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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"]);
}

About

Simple read-only tabular data structure like a light-weight DataTable

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published