Search Wiki:


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
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());

tkstock wrote  Feb 2 2011 at 3:15 PM  
Hi, came across this yesterday. I'm developing a windows service in VS 2010 to utilize this library to push canned search results (of a particular RSS feed) to a Sharepoint List. Everything is compiling correctly, but when I run it and it gets to = new SPSite(SiteUrl);

it tells me that it cannot find the web application. How do you specify the application URL? My Sharepoint application runs on port 90, so I've tried all variations of [machine]:90, http://[machine]:90/, etc. BTW, the sharepoint site is on another machine - don't know if this is a problem...


Page view tracker