Friday, December 21, 2012

SQL Server blocked access to procedure 'sys.xp_cmdshell' of component 'xp_cmdshell' because this component is turned off

SQL Server blocked access to procedure 'sys.xp_cmdshell' of component 'xp_cmdshell' because this component is turned off as part of the security configuration for this server.
This is a common error when a stored procedure tries to execute xp_cmdshell command, by default 'xp_cmdshell'is disabled. To enable this in Sql Server 2008 R2, you need to right click on the server name and select 'facets'.

Have patience as it takes some time to load the 'view facets'window. Now select the drop down next to 'Facet' and select 'Surface Area Configuration'. Now turn the property for 'XPCmdShellEnabled' to True. Hit Ok and you are done.

If you want to run the script, you can visit xp_cmdshell Option

Monday, December 27, 2010

Knet e24paymentpiper.dll errors


If you have reached this post then you must be frustrated with the numerous errors when trying to implement the e24paymentpipe.dll.

there are not much documents available online as well as this payment gateway is specific to kuwait banking system.

this is a common error
Retrieving the COM class factory for component with CLSID {78EEF9EE-38E9-11D5-9B13-00E0B8184571} failed due to the following error: 80070005

to successfully implement this dll, do the following:

1) Upload e24paymentpipe.dll to the bin folder on your hosting server
2) Register this dll on the system (ask your hosting provider to do this)
3) Assign ASP.NET rights to this e24paymentpipe.dll (ask your hosting provider to do this)
4) Create a folder named "Resource"
5) Upload the file "resource.cgn" to the "Resource" folder
6) Assign ASP.NET rights to this folder (ask your hosting provider to do this)

Here are the changes you need to make in your test code:

=====start of code===========


string product, price, qty, total, name, address, postal; // Declaration of variables
e24PaymentPipeLib.e24PaymentPipeCtlClass MyObj;
MyObj = new e24PaymentPipeLib.e24PaymentPipeCtlClass(); // Create an instance of the dll object

total = Request.QueryString["total"];

MyObj.Action = "1"; // Purchase Transaction
MyObj.Amt = "100"; // <----This is the amount i entered for testing, The amount of purchase
MyObj.Currency = "414"; // KD Currency
MyObj.Language = "USA"; // Payment Page Language
MyObj.ResponseUrl = ""; // Your response URL where you will be notified with of transaction response
MyObj.ErrorUrl = ""; //
MyObj.TrackId = (new Random().Next(10000000) + 1).ToString(); // You should create a new unique track ID for each transaction
MyObj.ResourcePath = @"CompletePath\Resource\"; // <---Make sure you have the right path to this folder, Directory to your resource.cgn ending with \
MyObj.Alias = "yourwebsitealias"; // Alias of the plug-in, case-sensitive
MyObj.Udf1 = "User Defined Field 1";
MyObj.Udf2 = "User Defined Field 2";
MyObj.Udf3 = "User Defined Field 3";
MyObj.Udf4 = "User Defined Field 4";
MyObj.Udf5 = "User Defined Field 5";

//Perform the payment initilization

====end of code========

If your hosting provider cannot help you with this then try this hosting provider, it has been around since 2001 and provides Business class webhosting or write to me and i can assist you with the hosting and code.



Friday, June 25, 2010

Resolving Visual Studio 2010 Installer issues

If you got this error "Error: The version of the .NET Framework launch condition '.NET Framework 4' does not match the selected .NET Framework bootstrapper package" then you are at the right place.

Few days back i installed "Visual Studio 2010", i am always very excited testing new software.
So i created a new project and under target .Net Framework i selected "3.5 Framework".
I added a New Project Setup& Deployment Installer package. I then compiled it, and tried installing. The application came up with ".Net 4.0 Client framework required". But wait i was targeting .Net 3.5 framework so why did i get asked for ".Net 4.0 Client Framework"?
Well after doing some searches and going through forums, i finally discovered that in the installer project for some strange reason Visual Studio still keeps the launch condition prerequisite as ".Net 4.0".

Here are the steps to resolve this issue.
1) select installer project

2) click on the icon on top "Launch Conditions Editor" its the icon with a binoculars.

3) Under Launch Conditions, Select ".Net framework" on the right in "Properties" Select "Version" you will see a drop down. change the framework to your target framework.

Build and install.


Wednesday, November 18, 2009

Installing Sitefinity on Shared Hosting with Medium Trust

My recent project required use of CMS, after researching i zeroed down on Sitefinity. I have been a fan of Telerik components so i decided to go with Sitefinity as they have all the features i needed and their support is fantastic.
For Sitefinity to work with its full functionality you need to host it with Full trust, but i decided to host it on a shared hosting for saving on cost and reliability of my host. I hosted with

Here are the steps to deploy Sitefinity to your shared hosting with medium trust.
In medium trust you cannot use HealthMonitoring and Workflow. Depending on your host provider there could be issues related to RadUpload - uploading of files, uploading of zip, RadProgressArea should be also disabled.
Before setting the trust level to medium, make sure you modify the application web.config file as
described below:

1. Disable page and module workflow *:

allowPageWorkflow="false" name="Sitefinity"
type="Telerik.Cms.Data.DefaultProvider, Telerik.Cms.Data" />

securityProviderName="" allowLocalization="False"
allowVersioning="True" allowWorkflow="false

securityProviderName="" allowLocalization="true"

applicationName="/Blogs" allowVersioning="True"
allowLocalization="False" localizationProviderName=""

2. Disable health monitoring:

3. Make sure the following lines are commented out:

4.The Sitefinity module providers cannot get their database objects created in medium trust environment and you may get errors.
To prevent this, you need to enforce database upgrade in full trust environment,
in your local Web site. Creating at least one content item in each module before uploading the upgraded
database to the production server and setting the trust level to medium will initialize all modules in the
database. The Sitefinity Search service does not work in medium trust environment.

RadMemoryOptimization requires ReflectionPermission in order to operate correctly. This means that
in normal circumstances you will have to run your application with Full Trust permissions set, unless
you create a custom security policy, which allows ReflectionPermission. If you are unable to set Full
Trust or custom security policy, the solution is to put the Prometheus controls assembly in GAC.

The Upload Control functionality is not available in medium trust environment. You need to upload the
controls manually through the application web.config file.The upload of .ZIP files in the Images & Documents module is currently not possible in medium trust environment.

5. Now copy all your files to your host

6. Give App_Data read and write permissions for ASP.Net/Network Service.

7. You can ask your host to attach the database to Sql Server, and you can then change the connection string . web.config file.

8. Log on to the Administration control and Select Administration Tab -> Services
Select Search and select "Start Indexing" on the right pane. This will index your website and now you can use the search engine.

Hope this helps, here is the sample website i have deployed

Friday, November 13, 2009

Moving from one hosting provider to a new one

Moving from one hosting provider can be a headache for novice users, who are not aware of how to update name servers.
Follow these steps and you will save yourself some frustration:
1) Find a hosting provider after doing some good research, don't jump on the cheap bandwagon. Do some research, view feedbacks from other users. The most important thing for any hosting provider is their customer service, so make sure your hosting provider has a online chat, phone number to get in touch during emergency.
2) Once zeroed down on your new hosting provider, sign up for an account.
3) You will receive the new name servers such as and along with the IP's.
4) Before you update the name servers with your domain registrar, make sure you download your emails and webfiles from your current hosting account.
5) Login to the control panel of your domain registrar, this is where you have registered your domain name. Don't confuse this with your hosting account.
6) Go to the namserver section in your control panel and replace the old entries with the new name servers.
7) Save the settings, usually it takes few hours to update the DNS servers around the world, but max can be12 -48 hours for the DNS around the world to refresh.
8) Check your website every few hours, once you can see your new server, you can stop your account with your old hosting provider.

Any questions just post it!

Wednesday, September 2, 2009

Retrieving the id of last inserted record - PostgreSQL

PostgreSQL 8.3

To get the id of the inserted record we make use of the new function "returning" along with "nextval".

Dim NextRecord as integer

Dim cmd As Odbc.OdbcCommand = New OdbcCommand ("INSERT INTO mytable (myid, column1, column2) VALUES (nextval('mytable_myid_seq'), ?,?)

cmd.Parameters.Add(New OdbcParameter("@column1", column1value))
cmd.Parameters.Add(New OdbcParameter("@column2", column2value))

NextRecord = cmd.ExecuteScalar

myid is the auto increment column in the table.
nextval retrives the number which will be generated
returning returns the new myid.

Note: if your column names or sequence have capitals then do add double quotes
example: ""ColumnNames""



Thursday, August 6, 2009

PostgreSQL and .NET

Recently my .NET project required me to use PostgreSql as the database server.
The steps to connect to PostgreSQL from .NET are as follows
  1. Download the odbc driver from
  2. Run the installer

Connection string:

Dim hostname As String = "localhost"
Dim port As String = "5432"
Dim user As String = "myuser"
Dim pass As String = "mypass"
Dim db As String = "myDB"
Dim connstr As String = Nothing

connstr = "DRIVER={PostgreSQL ANSI};SERVER=" + hostname + ";UID=" + myuser + ";PWD=" + mypass + ";DATABASE=" + db

Dim DB_connection As Odbc.OdbcConnection = Nothing

DB_Connection = New OdbcConnection(connstr)

'Open the connection