Article archive
Read from SQL database
22/04/2015 17:18
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data.SqlClient;using Microsoft.SharePoint;namespace SQLconnectionConApp{ class Program { static void Main(string[]...
Assembly tokens in Visual Web Part
14/04/2015 13:53
Visual web part assembly tokensin .ascx file<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>in .webpart file <type name="yourNamespace, $SharePoint.Project.AssemblyFullName$" />
Connection string example
10/04/2015 16:36
<add key="MyConString" value="Data Source=mySqlServerName;Initial catalog=myDbName;Integrated Security=True;" />
The tools version "12.0" is unrecognized. Available tools versions are "2.0", "3.5", "4.0"
08/04/2015 13:36
The tools version "12.0" is unrecognized. Available tools versions are "2.0", "3.5", "4.0"this error occured when project was created in Visual Studio 2013 and moved and opened in Visual Studio 2010.Workaround is to replace ToolsVersion attribute in csproj file with e. g. 4.0.
Add fields to sharepoint list
31/03/2015 15:08
This script creates sharepoint list based on 'custom list' template and adds few fields of type- renames default Title field- single line of text- date- user- note (rich text)Then also hides some of them from Edit form$webUrl="https://yoursitecollection"Add-Pssnapin microsoft.sharepoint.powershell...
Sharepoint javascript Search.asmx QueryEx
27/03/2015 11:01
Use following html / js call to get search results from Search.asmx service by using QueryEx method.- Replace siteUrl in ajax call with your- Parsing is not correct, but you can see the service response<html><script type="text/javascript"...
Server was unable to process request. ---> Attempted to perform an unauthorized operation
26/03/2015 17:04
Error during web service call, calling Search.asmx from console applicatinServer was unable to process request. ---> Attempted to perform an unauthorized operationHere is nice article about this error, but my issue was I forgot to assign url to service instance. When I added it, code ran without...
Sharepoint javascript Search.asmx GetQuerySuggestions
26/03/2015 15:43
Example how to get search suggestions in Sharepoint 2010 using javascript web service call of Search.asmx- update your site collection url- this html page is not supposed to be on sharepoint, if so, you can use relative site collection url from _vti_bin)<html><script type="text/javascript"...
Set SharePoint search suggestions
26/03/2015 13:09
In case we want to hardcode search suggestions for sharepoint search box, we can use following code:It's working in SharePoint 2010, uncomment $searchOwner parameter and its call for SharePoint 2013 (in 2013 it's required)Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction...
Call Sharepoint Search service from Console Applicaton
26/03/2015 11:25
When we need to call Search.asmx service from other sites, we can use following code:(first Add Web Service Reference to your console application project and name it e. g. SearchWS)Update your site collection url and your credentials if needed(If you get an error, check if Web application is not in...
Items: 91 - 100 of 384