Monday, July 4, 2011

ASP.NET: Prevent button double-click

Problem

How to prevent button double-click on ASP.NET page

Solution

Add following code to Page_load. This code prevents button double-click on client-side but still executes code at server-side:

VB.Net

btnSave.Attributes.Add("onclick", " this.disabled = true; " + ClientScript.GetPostBackEventReference(btnSave, Nothing) + ";")

C#

btnSave.Attributes.Add("onclick", " this.disabled = true; " + ClientScript.GetPostBackEventReference(btnSave, null) + ";");

Thursday, November 25, 2010

CRM Adapter 4.0 installation to Biztalk Server 2010

Problem

You might receive an error "Microsoft Biztalk Server 2006 is not installed. You must install Microsoft Biztalk Server 2006. Then, try running Setup Again" when running CRM Adapter 4.0 setup

Solution

Edit ProductName value at HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\BizTalk Server\3.0 to Microsoft BizTalk Server 2006 and then run setup again. After setup is complete you can change ProductName back to Microsoft BizTalk Server 2010

Thursday, November 18, 2010

There was a failure executing the receive pipeline: Verify the schema for this document specification is deployed and is in the Global Assembly Cache

Problem

You might receive this error "There was a failure executing the receive pipeline: Verify the schema for this document specification is deployed and is in the Global Assembly Cache" in Biztalk 2010 while trying to submit a message to the receive location which is published with the WCF Service Publishing Wizard.

Solution

By default WCF service is running inside AppPool which is configured to use .Net Framework 2.0. Change WCF service AppPool to one which uses .Net Framework 4.0

Wednesday, August 11, 2010

Workaround: Running ASP.NET 1.1 on Windows 64-bit

Problem

IIS manager crashes when modifying ASP.NET 1.1 sites on 64-bit Windows

Solution

Here is a long and good explanation how to solve the problem: http://blogs.iis.net/wonyoo/archive/2009/06/18/workaround-running-asp-net-1-1-on-vista-sp2-ws08-sp2.aspx

Short explanation:
1. Create the Framework64 directory for 1.1 \windows\microsoft.net\framework64\v1.1.4322\config\
2. Copy the 32bit config to 64bit config location created in step 1.
Copy file from \windows\microsoft.net\framework\v1.1.4322\config\machine.config to \windows\microsoft.net\framework64\v1.1.4322\config\

Wednesday, March 24, 2010

WCF: Error in deserializing body of reply message

Problem

You got an error "Error in deserializing body of reply message" when calling WCF service.

Solution

If your response message size is huge then check the reader quota settings in client app/web.config-file at bindings section and change them. For example:

<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>

Note that you must have same binding, which settings you are changing, in server side also!

More about reader quota: http://msdn.microsoft.com/en-us/library/ms731325.aspx

Tuesday, March 16, 2010

WCF Oracle adapter: Field xxx has a value with time zone information set. Specify a value without time zone

Problem

I tried to call a Oracle stored procedure from orchestration with WCF Oracle Adapter.

My source message contains a date element like this <deliveryDate>2010-03-17T16:20:34.252125+02:00</deliveryDate> and when I put that value to destination message which is sent to Oracle: <DELIVERYDATE>2010-03-15T16:20:34.2365000Z</DELIVERYDATE>

I got an error "Microsoft.ServiceModel.Channels.Common.XmlReaderParsingException: Field DELIVERYDATE has a value with time zone information set. Specify a value without time zone.


Solution
Destination messsage date value should be modified to XML date format without timezone:

DateTime date = XmlConvert.ToDateTime(xmldate, XmlDateTimeSerializationMode.Unspecified);
DestinationElementValue = date.ToString("yyyy-MM-ddThh:mm:ss"));

Wednesday, December 30, 2009

Looping in stored procedure

Problem
How to loop through the select result in a stored procedure

Solution
DECLARE @MyId int
DECLARE Scroller SCROLL CURSOR
FOR SELECT MyId FROM MyTable

OPEN Scroller
FETCH NEXT FROM Scroller INTO @MyId
WHILE @@FETCH_STATUS = 0
BEGIN
INSERT INTO MyTable2 (ReferenceId) VALUES (@MyId)
FETCH NEXT FROM Scroller INTO @MyId
END

CLOSE Scroller
DEALLOCATE Scroller