Search Wiki:

ListDataTable

Expose SharePoint (WSS 3.0) Lists as DataTables!

While the default SPList type can return a DataTable (via SPList.Items.GetDataTable), it's disconnected--no databinding--and can't be used to make updates back to the list. Plus, it doesn't have the right schema when it's empty.

ListDataTable solves these problems, effectively giving you a DataTable bound to the list, respecting Inserts, Updates and Deletes.


Last edited Jan 26 2008 at 1:19 AM  by Markarend, version 2
Comments
caseyc wrote  Jan 28 2008 at 12:12 PM  
This sounds like a great idea, and was eager to try it out ... but no files are attached??? Or is this me missing something obvious here?

Markarend wrote  Jan 28 2008 at 8:14 PM  
Site is just going live "for real" today and there was a problem with file upload last week... try the Releases tab now!

sancy2k wrote  Apr 8 2008 at 2:00 PM  
Code fails for concurrents updates in multiuser environment

use this instead ....

DataTable _dt = new DataTable();

foreach (SPField spf in _lst.Fields)
{
_dt.Columns.Add(spf.InternalName.ToString(), spf.Type.GetType());
}

Updating...
Page view tracker