only My site

Wednesday, June 27, 2012

Database ID and Kill the process

During resore the database if some process or a connection exists, the SQL Server will not allow us to do the Restore or other tasks. So we have to know the process ID and Database ID to close (kill) the running process.

The below are the code to identify the DB ID, SP ID and demonstrated the KILL syntax.

--SELECT SPID,DBID FROM SYSPROCESSES WHERE DBID NOT IN (1,2,3,4)
--To Know the DB ID
SELECT DB_ID(N'DATABASE_NAME_HERE') AS [Database ID];
SELECT SPID,DBID FROM SYSPROCESSES WHERE DBID = (SELECT DB_ID(N'DATABASE_NAME_HERE'))
KILL 58


Monday, June 25, 2012

Workflow - Custom Activity

Workflow

Creating custom activity in Workflow Part – 1
http://www.sharepointkings.com/2010/03/creating-custom-activity-in-workflow.html

To create a custom activity designer with a drop zone using WorkflowItemPresenter
http://msdn.microsoft.com/en-us/library/dd489419.aspx
http://channel9.msdn.com/shows/Endpoint/endpointtv-Screencast-Lab-Introduction-to-Workflow-in-NET-4/

After creating the activity we need to add it to the sequence by using the below code Context.ScheduleActivity(Activity);

Text Search and Format Tool - gVim

Vi pronounced vee-eye was written by William Joy in around 1976 at The University of California, Berkeley. Vi was created by hacking various other editors around at the time and writing new code.

We can download the tool http://gvim.en.softonic.com/ and read the tutorial from https://supportweb.cs.bham.ac.uk/documentation/tutorials/docsystem/build/tutorials/gvim/gvim.html

SPSite.OpenWeb In-Depth

Usually there is some confusion in using the open web method with parameter. Without parameter it will open the site which is mentioned in the string URL of the sitecollection. The below MSDN link provides a detailed information with samples in Matrix format to clear all the doubts. It is worth reading this MSDN article.

http://msdn.microsoft.com/en-us/library/ms474633.aspx

Sample for OpenWeb()

string strUrl = "http://MyServer/MyWebSite/Lists/Announcements/AllItems.aspx";

using (SPSite oSiteCollection = new SPSite(strUrl))
{
    using(SPWeb oWebsite = oSiteCollection.OpenWeb("MyWebSite/MySubSite"))
    {
        Console.WriteLine("Website: " + oWebsite.Url);
    }
}

Tuesday, June 12, 2012

SharePoint 2010 Ribbon Overview

Microsoft changed the sharepoint UI as same as office 2010 UI (with menu and ribbon). Creating ribbon UI is fun and need creativity to plan the application implementation so that user feel the application as user friendly. When I think about user friendliness, I always think about the Microsoft Excel and still people love it due to its friendliness.

To create a Ribbon we need to add a Empty Element Item using the Visual studio and write the XML script to render the ribbon UI. The below screen shots shows the samples with XML and output. The example is defined for Document Library (101).

The sample source code is available in http://www.sharemuch.com/download/


PowerShell Basics








Source : Internet / Tallbott Crowell

PowerShell References

Microsoft Dynamics CRM & Sharepoint 2010

Friday, June 1, 2012

Sharepoint 2010 : UI - Status Bar, Notification & ModalDialog

The Interesting part in Sharepoint 2010 is UI improvements and new features such as 

1. Status Bar
2. Notification
3. ModalDialog,
4. Themes

All these features require Javascript Framework/library and it is in sharepoint root\templates\layouts\SP.js

Note : Click the below images to see the enlarged image.