Tag Archives: Quick fix

SSRS Query execution failed … Expected parameter …

Consider following scenario: While developing for SQL Server Reporting Services you created a report in Business Intelligent Studio (or generated RDL file elsewhere and then added it to Studio’s project). Everything works fine, you’re able to preview report. And then you need to change Data Source (one example: you created a shared Data Source and now want your report to use it). After you do that any attempt to run the report results in error: Query execution failed … Expected parameter ….

The reason in this case – when you change the data source thru GUI – it resets query used by the report. It can change query type from StoredProcedure to Text and also remove all default query parameters (hence error above).

There’re 2 possible solutions here: First – instead of using GUI, manually change Data Source in the XML source of the report file (in Solution Explorer right mouse click on the report file and select “View Code”). You will have to change it in several places, so be careful. Second – re-create query with its default parameters after changing Data Source in GUI.

Error using Crystal Reports 2008 in ASP.NET application on 64bit server

If you’re using Crystal Reports 2008 in your ASP.NET application, and after deploying to a 64bit server getting following error:

An error has occurred while attempting to load the Crystal Reports runtime. Either the Crystal Reports registry key permissions are insufficient, or the Crystal Reports runtime is not installed correctly. Please install the appropriate Crystal Reports redistributable (CRRedist*.msi) containing the correct version of the Crystal Reports runtime (x86, x64, or Itanium) required. Please go to http://www.businessobjects.com/support for more information.

then switch your application to 32bit mode. In case of Windows 2003/IIS6 entire server will have to be switched, in case of Windows 2008/IIS7 a dedicated 32bit application pool can be established for your application.

UltraWebGrid in Infragistics 9 displays default column captions.

Recently I upgraded an ASP.NET project from ancient 6.3 version of Infragistics to current (at the moment) 9.2. Suddenly UltraWebGrid control began to display an unpleasant effect – columns that used to have no caption now showed what appeared to be default captions:

New look of UltraWebGrid

Looking at grid’s HTML markup I noticed that it set the caption to an empty string (showing code for one column):

<igtbl:UltraGridColumn HeaderText="">
   <Header Caption="">

Apparently it’s a new behavior in Infragistics 9.x to substitute empty captions with default column names. The solution is to set caption to a single space which, while invisible, is considered a real text caption and is not substituted by anything:

   <Header Caption=" ">

The result:

Correct look of UltraWebGrid

Visual Studio 2003 hangs trying open ASP.NET project from Visual SourceSafe

If you still use Visual Studio .NET 2003 (I still do for some older .NET 1.1 projects) you may experience following situation:

  1. You have an ASP.NET Web project that is controlled by Visual SourceSafe
  2. While opening the project Visual Studio 2003 hangs, stops responding to mouse clicks and keystrokes.

Fortunately there is a quick fix to that.
Continue reading →

Postback disabled/readonly Textbox that was modified in JavaScript

Let’s say in your ASP.NET application you set a TextBox control’s property ReadOnly to True (or Enabled to False) to prevent user from entering data directly. But you still want to update that text box’s value via client-side JavaScript. Which is happening, the value can be updated.  But during postback to the server – surprise, surprise! – the new value doesn’t persist. This is due to security precaution – if the value wasn’t meant to be changed – the change is not allowed. But there is a way around this.

Continue reading →

Method ‘System.Object CompareObjectEqual(System.Object, System.Object, Boolean)’ has no supported translation to SQL. Solution to error

I was running a basic LINQ 2 SQL statement:

From role In db.user_role _
Where role.USER_ID = Session("user_id") Select role

when I encountered following error message:

Method ‘System.Object CompareObjectEqual(System.Object, System.Object, Boolean)’ has no supported translation to SQL.

After a little research I found the solution.
Continue reading →

Infragistics WebDataMenu: Expanding context menu UP

Infragistics WebDataMenu is a light-weight highly responsive menu control with rich server and clinet side model. I was using it to display context menu on right mouse click.  The code is pretty simple:

function onMouseClick(oEvent) {
   if (oEvent.button == 2) { //right mouse button clicked
      var menu = $find("xwdmMyMenu");
      menu.showAt(null,null, oEvent);

It checks whether the right mouse button was clicked (line 2) then locates the menu object and shows it using showAt method (which accepts 3 parameters, either X and Y client coordinates, or event object from which it derives coordinates of the mouse click).

 It’s all well and good, but the problem is – menu always shows down from the location of the mouse click. And if the click is at the bottom of the screen – menu gets cut off:

I needed to make menu expand UP and  couldn’t find a build-in property or method that would change this behaviour (GroupSettings.ExpandDirection property had no effect). Time for a little hack. Continue reading →

Correcting “ASP.NET AJAX client-side framework failed to load” error

If you’re trying to use ASP.NET AJAX features (like Script Manager or Update Panel) in your ASP.NET 3.x website and getting “ASP.NET AJAX client-side framework failed to load” error, chances are your Web.config file is missing required sections. Fastest way to correct this is to create a new ASP.NET website in Visual Studio (you can delete it afterwards) and copy missing sections from the new web.config to the one in your web site.

Update: As churawut pointed out missing .AXD mapping in IIS configuration is another common source of this error (often this is done as security hardening on the IIS).  I encountered it while researching missing images in ASP.NET charts, and found out that underlying reason was missing/corrupt .AXD mapping in IIS.