accessing sharepoint data

Jun 30, 2007 at 10:43 PM
how can i access sharepoint specific data, such as the custom list via the user control? also, is it possible to triger a sharepoint workflows?
Jul 2, 2007 at 5:32 PM

nadirkamdar wrote:
how can i access sharepoint specific data, such as the custom list via the user control? also, is it possible to triger a sharepoint workflows?


//do the following to read list data within sharepoint:
//this works after you deploy the user control to sharepoint
SPWeb web = SPContext.Current.Web;
SPList list = _web.Lists"YOURLISTNAME";

//But if you want to debug it in web application, use this (assuming that you are developing in a machine running sharepoint)

//FOR DEBUG ONLY
SPSite site = new SPSite("http://sharepointsite");
SPWeb web = site.OpenWeb();