Archive for the ‘Uncategorized’ Category

In Crystal Report Web Viewer, image button icons do not appear in a new web site other than the Default web site in IIS.

November 5, 2012

Why Can Fail?!

You have created a web based Crystal Report Viewer in the IIS default web site. Everything looks fine. However, when you move it to a different web site under a different application pool, the crystal report viewer button icons all goes missing, becoming red “x”s.

Why Like That?!

This is because the image icons for Crystal Report viewer actually reside in aspnet_client folder, rather than the application directory. It is already included in the default web site, (C:\inetpub\wwwroot\), so the buttons will appear with no issues. If you move it to a different web site without a reference to the aspnet_client directory, the crystal report viewer will be unable to find the images and display red “x”s.


What To Do?!

In your newly created web site, create a virtual directory reference called “aspnet_client” and point it to the original folder path (C:\inetpub\wwwroot\aspnet_client), with the same permissions.

Where Got Say?!
The solution is inferred from a few sources, which mentions copying the aspnet_client image files to your application directory. (Not a good idea IMO). Still, credit goes to them for figuring out the cause of the issue.

2 references are stated here

Import Data from Text file fails in SQL 2005 with error 0xc02020a1

July 20, 2012

Why Can Fail?!

You export some data from a database table as a text file. You run the SQL Server Import and Export Wizard, wanting to import the data into a table with the EXACT SAME STRUCTURE. You go through the steps, click on finish to start running and “Boom!”, SQL Server 2005 hits you with error logs such as these:

Error 0xc02020a1: Data Flow Task 1: Data conversion failed. The data conversion for column “Column 1” returned status value 4 and status text “Text was truncated or one or more characters had no match in the target code page.”.
(SQL Server Import and Export Wizard)

Error 0xc020902a: Data Flow Task 1: The “output column “Column 1″ (14)” failed because truncation occurred, and the truncation row disposition on “output column “Column 1″ (14)” specifies failure on truncation. A truncation error occurred on the specified object of the specified component.
(SQL Server Import and Export Wizard)

Why Like That?!

This probably has something to with the length of your table columns. Although the source and destination both have a length of e.g. 128.  in the SQL Server Import and Export Wizard they only set the column length into the temp tables they use to length 50  by default. (Huh?) If your data exceeds 50 characters, you will hit that error.


What To Do?!

After selecting “Flat File Source” as the Data source, look at the panel called “Advanced” on the left hand side of the wizard. Click on it, then you set manually set the length of the offending column(s) to whatever size you like. The property to change is called “OutputColumnWidth”


Where Got Say?!

The answer can be found here.

Hope this saves you the frustration of  wondering why SQL Server 2005 can’t even import a simple text file properly. 😉


Dropdownlist in Updatepanel does not work (play nice) in Sharepoint 2007 webpart

December 21, 2009

Why Can Fail?!

Put a dropdownlist into an AJAX Updatepanel inside a user control to suppress page refreshes during postbacks. Put that user control into a apsx page, works perfectly. Put that same user user control into a Sharepont 2007 webpart, the AJAX UpdatePanel fails to function as expected and we see ugy page refreshes.

Why Like That?!

From Microsoft, it is what they say.

“This issue occurs because both Windows SharePoint Services and ASP.NET AJAX cache some types of form actions. Therefore, conflicts may occur.”

A better explanation from Mike Ammerlaan:

“Windows SharePoint Services JavaScript has a “form onSubmit wrapper” which is used to override the default form action.  This work is put in place to ensure that certain types of URLs, which may contain double byte characters, will fully work across most postback and asynchronous callback scenarios.  However, if your scenarios do not involve double byte character URLs, you may successful disable this workaround and gain the ability to use ASP.NET AJAX UpdatePanels.”

What To Do?!

This is the workaround from the blogs.

Register a client startup script which disables this workaround, in addition to resetting the default form action:

<script type=’text/javascript’>_spOriginalFormAction = document.forms[0].action; _spSuppressFormOnSubmitWrapper=true;</script>
Embed the startupScript into the Page or user control that uses the UpdatePanel. e.g.
private void EnsureUpdatePanelFixups()
if (this.Page.Form != null)
string formOnSubmitAtt = this.Page.Form.Attributes[“onsubmit”];
if (formOnSubmitAtt == “return _spFormOnSubmitWrapper();”)
this.Page.Form.Attributes[“onsubmit”] = “_spFormOnSubmitWrapper();”;

ScriptManager.RegisterStartupScript(this, typeof(AjaxUpdatePanelPart), “UpdatePanelFixup”, “_spOriginalFormAction = document.forms[0].action; _spSuppressFormOnSubmitWrapper=true;”, true);

Where Got Say?!

Information gleamed from these sources:

Wordy MS explanation:

This issue occurs because both Windows SharePoint Services and ASP.NET AJAX cache some types of form actions. Therefore, conflicts may occur.

“window.scrollTo” javascript function does not work in Internet Explorer 6

August 1, 2008

Why Can Fail?!

This is a wierd one. I’m trying to call “window.scrollTo(x,y)” javascript function to scroll my sharepoint webpage to the end. Other than inheriting the sharepoint header, it can be considered a normal aspx page.In IE6, the page refuses to scroll. In Mozilla Firefox, the page scrolls just fine. Figures. :\

Why Like That?!

No idea. This is probably 1 of those javascript bugs in IE6. :\

What To Do?!

Found a workaround on the web. Encase the window.scrollTo method within a setTimeout method, and then it works.


setTimeout(‘window.scrollTo(0, 100)’,1);

This works in IE6. 🙂

window.scrollTo(0, 100)

This does not work in IE6. 😦

Where Got Say?!

This is the forum post from I got the workaround.

Error: The target principal name is incorrect

July 17, 2008

Why Can Fail?!

After <security mode=”Transport”> is set, when my web application tries to call my WCF service, which is residing on a different server, this error pops up.

“The target principal name is incorrect.”

( >_< )

Why Like That?!

Apparently this issue has to do with Kerberos authenication, NTLM, SPN and all those stuff. (welcome any others to give a more accurate definition of “all those stuff”) If the client and service reside on the same server, all works fine as it is using NTLM. On separate servers, Kerberos authenication is used, which fails.

What To Do?!

A workaround is to insert a dummy identity element into the endpoint section of the client config.

<endpoint name=””
contract=”ICalculator” >

<servicePrincipalName value=”MYSERVICE/MyMachine”/>


Ironically, what this does is to force the service to fall back to NTLM authentication after Kerberos authentication using the dummy identity element fails. The service does not fall back to NTLM authentication without a identity element, don’t ask me why…. ( @_@; )

A more concrete solution seems to define the ServicePrincipalName for the assigned username or run the service (or client) under higher privileges. Both of these solutions has yet to be tested. To be investigated further if time permits.

Where Got Clue?!

I got the information from these 2 forum posts.

Why I wrote this blog…

June 24, 2008

1. To say “Hello World!”

2. To clog up the tubes with more junk. (See Ted Stevens)

3. To further stress test the Wayback Machine. (See World’s Biggest Backup)

4. To act “hip” and hop on the “blogging craze”. (and test out :p

5. To mimic thousands of others and blog about my (mis)adventures with WCF, .NET and other programming stuff. (As if there isn’t already enough out there…:p)

6. To log the problems I faced during my programming, and then curse and swear at them (#$%&/@*?!…)

7. To note down how I resolved the problems , if they are ever resolvable in the first place. ( See (#$%&/@*?!…)

8. To let another fellow hapless programmer, whom just might chance upon this blog while searching for a solution to his/her problems, (see Cure All), and in the highly unlikely scenario,  find some information that just might be useful to him / her.

9. To act as a backup FAQ in case the that fellow hapless programmer happens to be me. AGAIN. (see 8.)

10. To say “Hello World!”

(Oops..Infinite Loop!) :p

Hello world!

May 12, 2008

Hello World! 🙂