Tuesday, May 31, 2011

How to generate live data for chat webpart in sharepoint 2010

How to generate the live data for "Chart WebPart in SharePoint 2010" using SharePoint List.
Visit
http://www.codeproject.com/KB/TipsnTricks/LiveData_ChartWebPart.aspx

Tuesday, May 24, 2011

updating sharepoint list programmatically

updating sharepoint list programmatically
Recently I encountered the new requirement which wanted to create "Import SharePoint List"
There were more than 700 rows to be updated on a column value had null.
try
            {
                SPSite site = SPContext.Current.Site;
                SPWeb web = site.OpenWeb("http://mosstemp:5000");
                SPList list = web.Lists["Prospects"];

                SPQuery query = new SPQuery();
                query.Query = "";
                SPListItemCollection items = list.GetItems(query);

                foreach (SPListItem item in items)
                {

                    item["Status"] = "Not Called";
                    item.Update();

                }
               
                control = new LiteralControl();
                control.Text = "Updated";
            }
            catch (Exception ex)
            {
                control.Text = ex.InnerException.Message.ToString();
            }
You can't update the "look up" column in the sharepoint list.

Tuesday, May 17, 2011

Retrieve List Item using SharePoint Client Object

This code retrieve the sharepoint list item using SharePoint Client Object Model
ClientContext context = new ClientContext("http://WIN-ASNOSC246SV");
var web = context.Web;
context.Load(web);

List list = web.Lists.GetByTitle("Friends");
context.Load(list);

CamlQuery query = new CamlQuery();
query.ViewXml = "";
ListItemCollection cols = list.GetItems(query);
context.Load(cols);

ListItem item = cols.GetById(1);
context.Load(item);

context.ExecuteQuery();
Response.Write(item["Name"].ToString());

Wednesday, May 11, 2011

Feel Good about myself

This is my first attempt to take MS 70-667 SharePoint configuration and Maintenance exam on "MeasureUp.com".When I test my knowledge on these topic on trial test engine page on my attempt,I have passed with 80%.I am really feel good about myself.:)-