Posts

SharePoint Query Classes and where to use them

Thanks to http://sivanesanb.blogspot.in/2013/02/sharepoint-query-classes-and-where-to.html

Add calculated data columns to datatable c#

DataTable workTable = new DataTable("Purchase Items"); DataColumn workCol = workTable.Columns.Add("ID", typeof(Int32)); workTable.Columns.Add("UnitPrice", typeof(Double)); workTable.Columns.Add("Qty", typeof(Int32)); workTable.Columns.Add("Total", typeof(Double)); workTable.Columns.Add("Discount", typeof(Double)); workTable.Columns["Total"].Expression = "UnitPrice*Quantity"; workTable.Columns["Discount"].Expression = String.Format("Total*{0}",Discount); dataGridView1.DataSource = workTable; dataGridView1.Update();

Interop type 'Microsoft.Office.Interop.Excel.ApplicationClass' cannot be embedded. Use the applicable interface instead.

In most cases, we are using the Interop Excel class like below. Excel. ApplicationClass  xlapp =  new  Excel. ApplicationClass (); Here it is enough to say that Excel.ApplicationClass derives from Excel.Application interface and one can even instantiate Excel using Excel.Application interface. Rewriting this code as below produces exact same results: Excel. Application  xlapp =  new  Excel. Application (); Typically, to change your code to use an interface type instead of a class type you just need to remove the 'Class' suffix and compile the code! Another way to find what the applicable interface is - look at the definition of the class type.

How to get to the DLLs in the GAC

Start -> Run -> C:\windows\assembly\gac_msil

Applying custom color to SharePoint 2013 Calendar

Image
LoadSodByKey("SP.UI.ApplicationPages.Calendar.js", function () {         WaitForCalendarToLoad();     });     var SEPARATOR = "|||";     function WaitForCalendarToLoad() {         SP.UI.ApplicationPages.SummaryCalendarView.prototype.renderGrids = function SP_UI_ApplicationPages_SummaryCalendarView$renderGrids($p0) {             var $v_0 = new Sys.StringBuilder();             var $v_1 = $p0.length;             for (var $v_2 = 0; $v_2 < $v_1; $v_2++) {                 this.$7V_2($v_2, $p0[$v_2]);             }             for (var $v_3 = 0; $v_3 < $v_1; $v_3++) {                 $v_0.append('<div>');                 this.$I_2.$...

Getting SharePoint List Items using JQUERY

< script type ="text/javascript" src ="/_layouts/images/Tri/jquery-1.6.1.min.js"></ script > < script type ="text/javascript" src ="/_layouts/images/Tri/jquery.SPServices-0.7.2.min.js"></ script > < script language ="javascript" type ="text/javascript">     $(document).ready( function () {         $().SPServices({             operation: "GetListItems" ,             async: false ,             listName: "Tasks" ,             CAMLViewFields: "<ViewFields><FieldRef Name='Title' /></ViewFields>" ,             completefunc: function (xData, Status) {        ...

SharePoint 2010 SP1 - Recovering Deleted Sites and Site Collections

Image
Get-SPDeletedSite  – this command gets a list of all deleted Site Collections in your farm. Restore-SPDeletedSite  – this command is used to restore a deleted Site Collection within your farm Remove-SPDeletedSite  – this command is used to actually clear out any deleted Site Collection you no longer want to keep (think "Empty Recycle Bin"). hope this will helps you ... happy coding ..