Thursday, 29 October 2015

How to remove item's Workflow& WorkflowState programmatically?

using ( new SecurityDisabler() )

Item["__workflow"] = string.Empty;
Item["__workflow state"] = string.Empty;
Item["__lock"] = "<r />";
Item["__default workflow"] = string.Empty;


Wednesday, 28 October 2015

How to get The Home Item of the Context Site

Sitecore.Sites.SiteContext contextSite = Sitecore.Context.Site; Sitecore.Data.Items.Item home = Sitecore.Context.Database.GetItem(contextSite.StartPath);

How to compare two table data in sql server

 SELECT * FROM tbl_NewData

 SELECT * FROM tbl_OldData  

Import Data from excel Sheet

 EXEC sp_configure 'Show Advanced Options', 1

EXEC sp_configure 'Ad Hoc Distributed Queries', 1

EXEC sp_MSSet_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'AllowInProcess', 1

EXEC sp_MSSet_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'DynamicParameters', 1


select * FROM   OPENROWSET('Microsoft.ACE.OLEDB.12.0',
'Excel 12.0 Xml;HDR=YES;Database=D:\DataMigrationFiles\New Data.xlsx',
'SELECT * FROM [Sheet2$]')

Please note we need to run the SSMS with Super user.

Tuesday, 20 October 2015

How to disable the Remember me checkbox on the login page

            If true, Sitecore disables the "Remember me" checkbox on the login page.
            Default: false
      <setting name="Login.DisableRememberMe" value="true" />

How can we Turn off Auto Complete of Username in the Login Page

            If true, an autocomplete="off" attribute is added on the Sitecore login forms on the /sitecore/login/default.aspx and 
            /sitecore/admin/login.aspx pages. This is useful, for example, if you don't want user names to be disclosed when editors
            log into Sitecore on shared/public computers.
            Default value: false
      <setting name="Login.DisableAutoComplete" value="false" />

How to prevent Cross-Frame Scripting

        <add name="X-Frame-Options" value="SAMEORIGIN" />

Can we encrypt the connection string in sitecore

Custom item url for Item Bucketing

Monday, 19 October 2015

how to not index all sitecore item in sitecore search

There is setting called Root in Index Definition in "Sitecore.ContentSearch.Solr.Indexes.config"

Here we can mentioned the root of our site to exclude the unwanted index..


Monday, 5 October 2015

Why not to use Sitecore Internal Links as Field Type in Sitecore Data Template

internal Links store references by item path rather then ID..That why we should not use Internal Links.
Use drop tree as back up.