.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

mdx case giving #error

Posted By:      Posted Date: September 04, 2010    Points: 0   Category :Sql Server
Basically I am trying to sum the NewCount across product &1 &2 .  If I remove NewCount and replace it standard Count I am able to get the results...guessing it's the way the cell are summed.  Any help will be great ! Thanks.    with MEMBER Measures.[NewCount] as format ( case        when [Dim Product].currentMember is [Dim Product].&[0] then Measures.[Count] * 1.24        when [Dim Product].currentMember is [Dim Product].&[1] then Measures.[Count] * 2.66        else 0      end   , "#" )  select     [Dim Date].[Year].[2009] on 0 ,  Measures. [NewCount] on 1  from   [DemoCube]   where   { [Dim Product].&[1], [Dim Product].&[2] }  

View Complete Post

More Related Resource Links

Giving syntax error for CASE statement using VS (SSAS) 2008 designer


Hi All,

I am writing following CASE statement in Data Source View-> Righ click measure table "xyz" -> and select "Edit Named Query"








Json Deserialization is giving error in IronPython



Have anyone tried json deserialization. When I tried:

>>> import json

>>> json.loads('["foo", {"bar":["baz", '"Test", 1.0, 2]}]')

I got following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\json\__init__.py", line
 307, in loads
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\json\scanner.py", line
42, in iterscan

HoverMenuExtender is giving me the error SYS.Extended.UI.PositioningMode.Aboslute is null or not an


Here is my Code....Any thoughts on what I am doing wrong? I pulled in the Ajax Tookit based on the instructions then was following the HoverMenuExtender tutorial.

Any info would be greatly apprecated!

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
    <form id="form1" runat="server">
<asp:ScriptManager ID="asm" runat="server" />
      <asp:Repeater ID="rpOrders" runat="server">
          <br />
          <asp:Panel ID="myPanel" runat="server" Width="400px" BackColor="Lime" BorderWidth="1px">
              <%#DataBinder.Eval(Container.DataItem, &quo

SSIS Package working on SQL Client Machine but when trying to run on SQL Server machine giving error

Hi We are trying to run SSIS package on sql server machine but sometimes it is giving error for data flow task containing Script Component. Error is - [SSIS.Pipeline] Error: component "SCR DimensionRelation" (1) failed the post-execute phase and returned error code 0x80004002. This error is not coming continuously. And also not for specific DFT. It comes for different DFTs as we rerun the package. Can anybody help me on this? We are using SQL server 2008. We are not getting any error on client machine :(:(

Validation.Error giving strange behavior

I'm seeing some weird behavior with the Validation.Error attached event. I have a textbox bound to an object that implements the IDataErrorInfo interface. The textbox subscribes to the Validation.Error event. What is weird is that when you put the text box into an invalid state, the Validation.Error event gets triggered twice. Under .NET 3.5, the first time ValidationErrorEventArgs.Action == Removed. The second time ValidationErrorEventArgs.Action == Added. Under .NET 4, it's reversed. The first time ValidationErrorEventArgs.Action == Added. The second time ValidationErrorEventArgs.Action == Removed. Why would it be called twice and why would it work differently under .NET 3.5 and .NET 4? I'm trying to implement a validation summary control similar to the one from ASP.NET. There is a solution here: http://codeblitz.wordpress.com/2009/05/12/wpf-validation-summary-control/ but it doesn't work under .NET 4 because in order for it work work, when you put a control into an invalid state, the last call to the Validation.Error event has to be with ValidationErrorEventArgs.Action == Added. Here is my code:   <Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:WpfApplicatio

Validation error: This property can not be set to a null value [updated with test case!]

Hi, In a dynamic data web application, I get a validation error on a non-null nvarchar(50) column in ListDetails.aspx, even though I have entered a value which should be accepted. The validation error is: "This property cannot be set to a null value.". I can not reproduce this on northwind/adventureworks. Any ideas? UPDATE: I have created a complete test case: http://printf.no/DynamicDataBugTest.zip (The archive was scanned with the latest AVG definitions before uploading to my private secure dedicated FreeBSD server) The test case contains: One Dynamic Data Web App project One MS SQL Server 2005 database backup which contains a single table with three columns One screenshot showing how the error manifests itself I am fairly convinced now that this is a reproducible DD bug. -Andreas

A customized EditForm.aspx page giving error because it has a "People and Group" field with a "Allow

My customized EditForm.aspx which has a "People and Group" column with the "Allow multiple selections" property as "Yes" was working fine until the Agusust cumulative update was applied into the MOSS server. Now it's giving me the error: "An unexpected error has occurred". Needless to say, when I change the "Allow multiple selections" property to "No", the customized EditForm.aspx page works fine.Forgetting whyMicrosoft introduced this error for now, is there a workaround that you are awre of?

SSIS package is giving error when ran thru JOB...its running good when I execute in BI Studio or Exe

Friends I am getting weird issue...I built an SSIS package. In one variable I used express builder and built like this... RTRIM( (DT_STR, 2,1252)  (((DT_I4) ( (DT_WSTR, 3) (SUBSTRING( @[system::machineName] , 12, 16 ))) +1) /2)) when I run the package outside ie., with VStudio or execute utility it running absolutely with out any problem. But when I created a job just to execute that package in particular timings...the job is totally failing by throwing error....the error output is like the following: Started:  10:22:33 AM Error: 2010-02-27 10:23:06.23    Code: 0xC00470C2    Source: Rerun_MissingFiles    Description: Error code 0x80020005 occurred attempting to convert from data type DT_WSTR to data type DT_I4. Error: 2010-02-27 10:23:06.23    Code: 0xC00470C4    Source: Rerun_MissingFiles    Description: Casting expression "(SUBSTRING( @[system::machineName] , 12, 16 )))" from data type "DT_WSTR" to data type "DT_I4" failed with error code 0xC00470C2. End Error Can any one help me please? Thanks in advance.

Giving me an error "Object reference not set to an instance of an object."

Hello Everyone, I am currently developing a website for online examination.  For that I have to collect user information at the time of registration. I want to develop a 3-tier application. I have SignUpWizard. Aspx page. I have also created 3 classes (Users.cs, UserDAL.cs and UserBAL.cs) and 1 stored procedure (InsertUserInfo).Code for Users.cs:using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Configuration; using System.Data.SqlClient; using System.Web.Security; using System.Data; namespace ITIL.DomainModels { public class Users { public int UserID { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public string Username { get; set; } public string Password { get; set; } public string EmailAddress { get; set; } public string dateTime { get; set; } public string IPAddress { get; set; } public string SecurityQuestion { get; set; } public string SecurityAnswer { get; set; } } }Code for UserDAL.cs:using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Data; using System.Data.SqlClient; using System.Configuration; using ITIL.DomainModels; namespace ITIL.DAL { public class UserDAL { publi

Error 15401 when adding AD logins in upper case to a sql 2008 server

We are repeatedly getting Error 15401 when adding couple AD logins in upper case(DOMAIN_NM\USR_NM) to a sql 2008 server with the latin1_general, binary sort collation.  Lower case (DOMAIN_NM\usr_nm) works fine.  All the other servers, even the ones with the same collation, it is the opposite, upper case works and not the lower case.  Looked for duplicate SIDs in the domain, on the sql server, did not find any.  Any idea what's going on?. 

Insert statement giving me syntax error


Good evening,


I have a MS Access table with the "ModelID" column set as AutoNumber and primary key. The ModelID is set as Field Size --> Long Integer, New Values --> Increment, Format --> General Number, Indexed --> Yes (No Duplicates).

Here is the code i am trying to execute, and is giving me an exception -> insert into syntax error:

string strInsert = "INSERT INTO tbl_Models (fName, lName, Image, Answer1, Answer2, Answer3, Answer4, Answer5, Votes, ImageHead, Age, Program, StudentID, PhoneNumber, EMail) VALUES (@fName, @lName, @Image, @Answer1, @Answer2, @Answer3, @Answer4, @Answer5, @Votes, @ImageHead, @Age, @Program, @StudentID, @PhoneNumber, @EMail)";
        OleDbCommand cmdInsert = new OleDbCommand(strInsert, myCon);

        cmdInsert.Parameters.AddWithValue("@fName", txtFirstName.Text.ToString());
        cmdInsert.Parameters.AddWithValue("@lName", txtLastName.Text.ToString());
        cmdInsert.Parameters.AddWithValue("@Image", FileUploadBody.FileName.ToString() + sRandomBody);
        cmdInsert.Parameters.AddWithValue("@Answer1", txtWhyBeAModel.Text.ToString());
        cmdInsert.Parameters.AddWithValue("@Answer2", "");
        cmdInsert.Parameters.AddWithValue("@Answer3", "

SQL query giving Sytnax Error



 I have a query which I would like to execute however since im not a real specialist Im unable to find what is exactly wrong in it.

If anyone of the experienced DBAs could give me some tipos would be appreciated

(query is not mine - it has been created by someone else)


ALTER PROCEDURE dbo.CH_SyncClientSummary 
  declare @UTCdiff int 
  set @UTCdiff = DateDiff(mi, GetDate(), GetUTCDate()) 
  declare @currentsite varchar(3) 
  select @currentsite = ThisSiteCode from SMSData 
  Insert into CH_ClientSummary(MachineID) 
  Select MachineID 
  From MachineIdGroupXRef

New installation of SQL Server 2008R2 -Giving time out error


Hi all

I did side by side installation of SQL Server 2008 R2 RTM with no CU and I given a Alies name to the installation,until now applications working fine.Yester day SAN storage devices(iSCSI) are upgraded with new software.

after that I am getting an error

"Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. (Microsoft SQL Server, Error: -2)"

action required I found in Microsoft site is "Make sure that you have configured the firewall on the server instance of SQL Server to accept connections"

realy I don't know where I have configure this setting Please some help regarding

Thanks in Advance


Stored procedure giving strange error


I have as stored procedure which executes a dynamic SQL  at the end. The dynamic SQL inserts into a temporary table declared at the begining of the procedure. When i execute the proc, it executes for a while and then gives me a truncation error.

When i test the code witht out the proc, it works fine and come back with the result set. I am not able to figure out what culd be the issue.

Kindly assist me in this..I have tried setting all colum lenghts to very high values then required but still it does not work when i execute the proc.

throw exception message giving internal server error on live site


using vb.net/asp.net 2005

when a user enters a bad email I am doing a check on this and throwing an exception message as follows, this works fine on the test site but for some reason the same code on the live site gives a "internal server error" (http code 500).  The code below:

            If isThisEmailValid(strEmailThatTheUserEntered) Then
		'do something


                Throw New Exception("You entered a bad email address.")

            End If

not certain why this is happening, I assume that it's some server or config difference between the test and live sites.  has anyone seen this before?  For a quick fix i'm registering javascript alert and showing the same text so it works but I would like to figure out why the code above is not working.

as always, thanks for your feedback


SQL Agent Job - PowerShell step giving escape token error



I'm confused as to why I'm getting this error:

The job step contains tokens. For SQL Server 2005 Service Pack 1 or later, you must use the appropriate ESCAPE_xxx macro to update job steps containing tokens before the job can run.).  The step failed.

The job is a single Powershell script step like this:


Get-ChildItem -path "\\server\share-Logs\" -recurse -include *.log | Where-Object {($_.CreationTime -le $((Get-Date).AddDays(-35)))} | Remove-Item


This runs fine from the PS command-line but after testing this part is causing the error: $(Get-Date.AddDays(-35)) , in the Job step

This isn't TSQL or a token - so I don't understand why it doesn't just get put as-is into the PS command-line when the job runs.

Any help appreciated.


Projects giving the error "Value does not fall within the expected range."


I have a solution that contains four projects. This morning, when I opened up the solution in SQL Server Management Studio 2008, three of the projects gave the error "Value does not fall within the expected range" and were marked as unavailable. I removed them from the solution. When I attempt to add them back to the solution, nothing happens. How do I fix this?


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend