Tuesday, November 19, 2013

Could not find stored procedure 'sp_dboption' while installing SharePoint with SQL 2012

To make use of SQL 2012 with SharePoint 2010 server should have SharePoint Service Pack 1 installed.


Or


You can go ahead with alter

http://beyondrelational.com/modules/2/blogs/28/Posts/15429/replacement-for-system-stored-procedure-spdboption-in-sql-server-2012-denali.aspx?utm_source=brdigest&utm_medium=email&utm_campaign=dailydigest



Cannot connect to the configuration database. SharePoint 2010

1. Run prompt
2. Type  Services.msc
3. Start SQL Server (MSSQLSERVER) service



Thursday, October 31, 2013

Client object Model managed Code C# SharePoint



using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint.Client;

namespace SPClient.NetConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            ClientContext clientContext = new ClientContext("http://igtehydzbnv02:8811/");
            Web site = clientContext.Web;
            List list = site.Lists.GetByTitle("TestListFilter");
            CamlQuery query = new CamlQuery();

            ListItemCollection itemColl = list.GetItems(query);


            clientContext.Load(itemColl);
            clientContext.ExecuteQuery();
            Console.WriteLine("Count: {0}", itemColl.Count);


            for (int i = 0; i < itemColl.Count; i++)
            {
                Console.WriteLine(itemColl[i]["Title"]);
            }
            Console.ReadLine();

        }
    }
}

Show SharePoint Error Page instead of Yellow ASP.Net error page

To show SharePoint errorpage do below changes in Web.Config file:

<SafeModeMaxControls="200"CallStack="false"DirectFileDependencies="10"TotalFileDependencies="50"AllowPageLevelTrace="false">

and

<customErrorsmode="On" />


To See Error message on Page itself do below changed in Web.Config file

<SafeModeMaxControls="200"CallStack="true"DirectFileDependencies="10"TotalFileDependencies="50"AllowPageLevelTrace="false">

and

<customErrorsmode="Off" />

Monday, October 28, 2013

File deployment to Site Assest or Style Library SharePoint

1. Add Empty Module to Solution
2. Create root folder inside empty module
3. Create Sub folders for JS, Images, CSS files.
4. Do File specific changes in Element.xml file

Sample Element.xml

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="TestDeploy" Path="TestDeploy" Url="SiteAssets">
    <File  Url="BV/Sample.txt" Type="GhostableInLibrary"/>
  </Module>
</Elements>


Solution Snap Shot:-



Check dupliacte in list SharePoint ECMA Script : Client object model

Screen Shots:-

 
 Solution:-

Tuesday, October 22, 2013

Import / Export List in SharePoint using PowerShell

Exporting SPList :

 Export-SPWeb "<Site URL>" -itemurl "/Lists/<List Name>" -Path "D:\ListFolder\TestExport.cmp"


Importing SPList:

 Import-SPWeb -Identity "<Site URL>" -Path "D:\ListFolder\TestExport.cmp"



It will create list with same name in the target site.

SharePoint document metadata not updating

I faced a weird issue today, Metadata for document which has lookup column was not updating even after saving the item. There was no erro...