Skip to main content

Posts

Setting up web server and continuous integration

Apart from creating website & app-pool in IIS, there are several steps which need to be performed when setting a new website on server. Setup Web Server There are few activities which you have to perform on Web Server: 1. Install Web Deploy [ Download ] 2. Install URL Rewrite [ Download ] 3. Make Sure .Net Framework feature is ON in Windows features 4. Create a standard user which could be used to deploy files to web server after successful build 5. Open "services.msc" and check that 'Web Deployment Agent Service' is running with the standard user credentials created in Step 4. 6. Run App pool and website with same standard user which is created in Step 4 7. Reset IIS Server Continuous Integration There are several tools which are being used for continuous integration but they perform same functions when we discuss about build and deployment. In this example, we are referring Jenkins [ Download ]. If msdeploy or any relevant command is be...

Get all Items inheriting another template

Working on different templates and Sitecore items, its very common requirement to know how many items are created with a specific template how many template are inheriting a base template or another template Sitecore provide this feature out of box however you need to write query to fetch the required items. Open Sitecore IDE (http://localhost/sitecore/shell/default.aspx?xmlcontrol=IDE) Goto Tools -> XPath Builder Write XPath Expression: /sitecore/templates//*[contains(@__Base template,'{1FE1328B-375B-4548-A53E-344FA61ACC90}')] In result section, it should show all templates which are inheriting base template with ID {1FE1328B-375B-4548-A53E-344FA61ACC90}. Similarly, query  /sitecore/content//*[@@templatename='Promotional Page'] should show all pages (under content) created with 'Promotional Page' template. On top of results, it shows the count of items and time taken to fetch the items. We can use fast query as well inste...

Sitecore - Moving items from web to master

In most of the cases, generally you create items in master database and publish to web/production data. However, sometimes few items are in web database and not in master. Reason can be anything, like you might have deleted it in master but did not publish the parent item or due to some other reason. If you are thinking, you will create package from web and deploy it in master, that will not work. :-) When you create package from master, it installs the items in master only and same is the case with web. Right and easy way to do is Transfer the item. Yes, you read it right. There is a provision in Sitecore to transfer the items from one database to another. Select the item which you want to transfer from one database to another. Right click on it and then select Copying. Click on Transfer. see screenshot Once you click on Transfer, it opens up a popup box. Click 'Next'. see screenshot After clicking on next, you have to choose the database where you wou...

Delete duplicate records from table in single statement (SQL Server)

Deleting duplicate records is very common requirement therefore multiple options are available to delete duplicate records. However this article provides the solution to delete the duplicate records using single statement. Delete from <TABLE_NAME> where <ID> not in ( select max(<ID>) from TABLE_NAME> group by <DUPLICATE_COLUMN>) For example: Employee table EmpId EmpFullName EmpSalary EmpTitle 1 Sumit Bajaj 5000 Dev 2 Amit 10000 SDev 3 Sumit Bajaj 5000 Dev 4 Priyanka 50000 Mgr 5 Umesh 10000 SDev 6 Umesh 10000 SDev 7 Amit 10000 SDev 8 Geetika 5000 Dev where few records are duplicate and need to be removed. For this table, delete query would be  Delete from Employee where EmpId not in (select max(EmpId) from Employee group...

Oracle SQL Developer Installation

After spending enough time on installing Oracle SQL Developer and respective issues, I thought of writing few easy steps to install it. Hope it would help and save your time. Steps to install Oracle SQL Developer(for windows): Download SQL Developer from Oracle site. Download Download JDK if it is not installed on your machine. Download Install JDK and then unzip SQL Developer Click on sqldeveloper.exe, it will ask for java.exe path Open the path where JDK is installed. It would be something like "C:\Program Files\Java\jdk1.7.0_40\jre\bin" depeneding upon which version you install. If it is giving any exception, remove the entry [SetJavaHome] from sqldeveolper.conf file from "..\sqldeveloper\sqldeveloper\bin\sqldeveloper.conf" and give the correct path of java.exe file. Please provide your feedback if you like the post.

Excess of technology ruins

M ost of us are using so many apps on mobile and spending plenty of time using those apps. Well, even I am not exception but excess of technology sometime ruins. I would like to narrate one incident where I used Google Maps and screamed after using it. I visited Dehradun, Uttrakhund from Gurgaon recently and chose Google Maps to show me the route. It showed me two ways and advised me to go via shortest route which I followed. After reaching half way, I found that road was damaged so badly that I was not able to proceed. After collecting information from villagers nearby, I got to know that this path was always like that. One of the villagers advised me not to go further on that path as for cars its not possible to cross. He advised me to take alternate route which was going through the villages. Thanks to Indian people who are so kind and helpful. Although that road was raw and some patches were there yet it was better then the path Google Maps proposed. By somehow, I could reach ...

Could not load file or assembly 'MySQL.Data' or one of its dependencies. Access is denied.

It is very common error with .net assemblies. When someone included dlls from outside, in the project, this kind of exceptions are generic. Here is the resolution. Open the file location ( MySql.Data.dll in this case ) Right click on dll and check its properties ( it should not be encrypted and should have right access permissions ) Run the project after assigning appropriate permissions. It should work now. Even after this if it does not work. Check in web.config that assembly information is added under <compilation> tag. It is advisable to included new dlls using nuget package reference. It will update its reference automatically. Happy Coding!!!