Get current logged user in list event receivers?

Leave a comment


SPUser user = properties.Web.CurrentUser;

Sort Datatable values in Ascending Order

Leave a comment


NameSpace:  System.Data

We need to use DataView.Sort Property

Let us consider you already have a Datatable dt with some content in it and you want sort it in ascending order by the column Rollno

Then…

DataView dvt=new Dataview(dt);

dvt.sort=”RollNno ASC”;

//then again assign that view to datatable dt.

dt=dvt.ToTable();

Reference: https://msdn.microsoft.com/en-us/library/system.data.dataview.sort%28v=vs.110%29.aspx

service bus unable to uninstall issue problem in sharepoint 2013 Workflow related

Leave a comment


Sometimes, you need to uninstall Windows Service Bus 1.0 and it will not disconnect “Leave the Farm”

Follow steps:

1) Open Run and Type regedit

Delete the \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Service Bus folder

Then go and do uninstallation it will be perfect

Mapping document icons using SPUtility.MapToIcon programatically in SharePoint 2013

Leave a comment


Hi,

Using document library when we upload a document suppose if we upload a pdf document . You can see a small pdf icon.

Based on the document type the icons will map in Default Document Library in SharePoint 2013.

Similarly we need to get that while doing programmatically for that we can make use of  SPUtility.MapToIcon

The original location of icons in the server will be at: C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\IMAGES

while in program the path will be like:http://doaminname:portnumber/_layouts/images/icdoc.png

string icon = SPUtility.ConcatUrls(“/_layouts/images”,SPUtility.MapToIcon(item.Web, SPUtility.ConcatUrls(objSPListItem.Web.Url, objSPListItem.Url), “”, IconSize.Size16));

Use Image Control in ASP.net

then

assign the

Image.Url=objSPListItem.Web.Url + icon;

Then you will get the icon related to the document type.

Note: SPUtility in sharepoint 2013 is a wonderful class which includes many useful methods.

Visit for more info: SPUtility

Identify the WorkerProcess W3WP while debugging ASP.NET application

Leave a comment


Sometimes we will debug an ASP.net webapplication by attaching a W3WP.exe process. While Attaching it will many w3wp.exe. To Know the particular w3wp.exe process for our webapplication we need to type a command in CMD.

1) Click Start

2) Run CMD

3) Goto folder by changing directory cd Windows > System32 > Inetsrv

4) Run appcmd list wp

then you will see all the list of processes

Error “Admin SVC must be running in order to create deployment timer job”

Leave a comment


Hi All,

While Deploying a WSP solution into a WebApplication in Powershell. You may face the issue or error as:

Admin SVC must be running in order to create deployment timer job”

To rectify it:

Just go to Enable the Services of SharePoint Administrator.

Go To Command Prompt and Type Services.msc. You will see a window contains all the list of services running.

Enable “SharePoint 2010 Administration” service.

Service name: SPAdminV4
Display Name: SharePoint 2010 Administration

Once you have Enabled or Started it that the command will run smoothly.

Change Account display name of sharepoint user

Leave a comment


We can use  powershell command to change sharepoint user display name.   Set-SPuser -identity “User name” -DisplayName “Display Name” -web Web url  

Eg: Set-SPuser -identity “i:0#.f|fwamembershipprovider|kdc1″ -DisplayName “kdc1″ -web http://xyz:117/

In case you get access denied while changing the display name, run powershell as administrator/Farm admin.

Older Entries

Follow

Get every new post delivered to your Inbox.

Join 253 other followers

%d bloggers like this: