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

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

12 months to Last month loaded using MDX

Posted By:      Posted Date: September 30, 2010    Points: 0   Category :Sql Server

I'm struggling to define a calculated member which sums up the measure from current loaded month in the time dimension to 12 months prior. For example, if the current loaded month into my [Date].[Date Hierarchy] is August 2010 then it should sum up from August 2009 to August 2010.

I tried to get the current loaded month using

CLOSINGPERIOD ([ Date].[Date Hierarchy].[Month Name],
strtomember("[Date].[Date Hierarchy].[" + cstr(year(now())) +"]"))

but it gives me the month of December instead of August.


Any Help?



View Complete Post

More Related Resource Links

Events don't show up in a specific month and in last days of months whose calendar view include day



I actually faced a strange problem which is that when I add events in september 2011, they don't show up in the calendar view and the view remains empty but they appear in the all events view but events in other months appear.

Another strange thing is that I was adding events in July 2011. In the calendar view of July 2011, the first 6 days of August appear but this isn't the problem but the problem is that when I add about 3 events in 31 July then about another three from 31 July to 4 August and then about 2 events from 1 to 4 August, the events are collapsed and the 3 more items appear but when I click the link, I don’t see the events that were just on 31 July and I tried this too in the end of March so it seems that the months whose calendar view includes some days from the next month have a problem.

And finally when I change the month to be october 2010, I get error page with the text:

An unexpected erro has occured.

web parts maintenance page: If you have permission, you can use this page to temporarily close Web Parts or remove personal settings. For more information, contact your site administrator.

and I checked in more than one calendar and in more than one site and it's the same, So I'm asking if any one faced something like th


How to calculate childs age,but when i enter childs age as '03/27/2007' it returns 3 years where as actual age is 2 yr 11 months

An endpoint configuration section for contract 'xxx' could not be loaded because more than one end



I'm trying to test calling a webservice, I've found several free ones on http://webserviceshare.com, but none of them work for me.  Some of them give example calling code in C# which I've translated to VB.NET, they're typically just two to four lines, I don't think I've translated them incorrectly.

On that I've tried is US Zip Validator.  I added a Service Reference to http://www.webservicemart.com/uszip.asmx?WSDL, called ZipService.

I then call it like so:

            Dim myZipService As ZipService.USZipSoapClient = New ZipService.USZipSoapClient()
            Dim myCity As String = myZipService.ValidateZip("27707")

I get the following error on the first line of code:

"An endpoint configuration section for contract 'ZipService.USZipSoap' could not be loaded because more than one endpoint configuration for that contract was found. Please indicate the preferred endpoint configuration section by name."

A page with information on this web service (including C# source code) is at:


Flex Your Data: Teach Old Data New Tricks with the Fully Loaded Advances in ADO.NET 2.0


ADO.NET 2.0 will streamline your data access development efforts. Its new features let you work better with XML and SQL Server, and they offer lots of other improvements as well. This article takes a detailed look at some of the more interesting enhancements and focuses on performance and flexibility.

Julia Lerman

MSDN Magazine April 2005

dropdownbox which selects records based on criteria (TODAY, THIS WEEK, THIS MONTH, etc)


I have a dropdownbox which I want to use to search records based on a timescale. The gridview populates results based from that search.

So here is how I want to work this;

If a user selects "today" - a list of records input today are populated. If "this week" is selected, a list of all records added within that week from todays date is populated.

I created a forum on this issue previously but to no avail whatsoever. How do I work around this problem?

Help would be much appreciated

How to process data AFTER page is completely loaded for the user?


I have some logging that has to be done, which are some database update or inserts.

However this logging is of no importance to the user, so I only want to process the data/logs after the page is completed for the user.
As of now, if I process the data while the page is loading, I go from 1.4 to 2.0 speed (server side time processing of code), which is quite a bit comparing it is of no use to the user.

So I want this code only executed after that the page is complete.

I've been checking out Ajax, async pages etc, but the problem is it still gets executed before the page is rendered to the client, which means the client will have to wait longer then it is not being processed.

I've been checking out Threadpool.queueBackgroundWorker, however if I get it correct, this will still be executed before the page is shown to the user, as it has to complete before the prerender.

Then I thought about creating a new thread, and do the processing there, which would not have my page waiting to complete the data/logging.
However when I have 100 or 200 users loading pages at the same time, then that would mean I would be creating 200 threads on those loads, which I doubt will be good for performance. So if I want to solve this, I would have to create my own threadpool and only assign for example a max of 40 threads to it which can pr

wss2.0 Infopath 2007 'This form requires connections to data sources when it is loaded. At least on


Hi all

I have a user who receives the error 'This form requires connections to data sources when it is loaded. At least one of these connections is not available. As specified by the form designer, this form will not open' when trying to Submit an infopath form located on a WSS2.0 site.

The user has been having this issue since upgrading to Office 2007 and IE7. I have had the user run an Office Diagnostics but this has not resolved the issue.

I am not aware of any other users experiencing this issue.

Any ideas please?

Azure One Month Pass


Just saw this Azure offer.  You can try Azure for free, no credit card required, for a full month.

25-08-2010 7-24-07 PM

Get all the details here and read the fine print (like US only)

Bookmark and Share

MVC view displays Preveously loaded data only



1. May be it loading page either from History or Chache memory.

2. When anonymous user open about-us page or Home page then we display only 4 menus. And immediatly Normal user logs in and

open about-us page or Home page it again display only 4 menus instead displaying all menus available for registered user. I

have used the PartialView and render it in Master page(use the code Html.RenderPartial("Menus")) see the following code...

<%@ Control Language="VB" Inherits="System.Web.Mvc.ViewUserControl" %>
<%: ""%>
<div id="menucontainer">
    <ul id="menu">       
            <%  If Request.IsAuthenticated = False Then%>
                <li><%= Html.ActionLink("Home", "Index", "Home")%></li>
                <li><%= Html.ActionLink("Register", "Register", "Account")%></li>

Crawler fails to register date properties of user profiles with the month of January, April, August


This seems to be a bug when the crawler search the user profiles in MOSS 2007.  When crawled, user profiles with a SPS-HireDate in the months of January, April, August and December will be detected, but a full-text (SQL) search returns those profiles without the HireDate field.

User profiles with HireDates in other months work correctly, returning the HireDate in the search.  And changing the month of a problematic user profile also fixes the problem.

This problem is also reflected in the fact that while we have 499 user profiles using the SPS-HireDate property,  the managed property page from the search section only has 350 items with the HireDate property.

We're running MOSS 2007 32bit with SP2 with an English language base and the Spanish language pack. I'd considered date format problems, but I can't imagine how some months would work, while others wouldn't.

Any ideas?

Applying custom CSS to the MOSS 2007 Calendar control Month view



I have a requirement to use the MOSS 2007 Calendar Control - month view is to apply a custom css to have a look and feel as per our requirements.

We tried applying the custom css to the MOSS 2007 calendar control - month view, it does take the custom css and applies it, but when i click on any date and come back to the calendar control, it changes the CSS of the MOSS calendar control back to the default one.

Let me know if anyone has any suggestion on  how to customize the calendar control for css for our intranet application.

Your response would be highly appreciated.






month days in gridview


 Hello all,

I have a challenge of which I can't figure out how to achieve it.

at this moment I have a gridview that can be dynamicly filled with cell's based upon the number of items selected (throug a drop down list) by a user.

the user then can enter some values in the cells to perform a bulk insert.

What I rather want is that the user selects a month, like august, and then  the gridview is filled with the amount of days from that month, so you get 31 cells in the gridview. second all the first cells should be filled with the daynumber for that day...

I hope the explanation is clear :)


Does anyone know a solution to this?





WPF ComboBox Loaded Event - Handling Globally

Hello, I am having trouble hooking up to a WPF ComboBox Loaded event when trying to do it globally with EventManager.RegisterClassHandler in the parent control rather than with XAML right on the control.  Here is the code for the ComboBox control: <DataTemplate x:Key="MyUIEditor"> <ComboBox Width='Auto' x:Name="Combo" ItemsSource="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:MyControlWPG}}, Path=MyCollection}" SelectedValue="{Binding Value}" DisplayMemberPath="Name" SelectedValuePath="FullName" Background="Transparent" /> </DataTemplate>   Here is the code for the global event handler:   public partial class MyControlWPG : UserControl public MyControlWPG() { InitializeComponent(); EventManager.RegisterClassHandler(typeof(ComboBox), ComboBox.LoadedEvent, new RoutedEventHandler(Combo_Loaded)); } The event handler gets hit when I declare Loaded = "Combo_Loaded" in the XAML right on the ComboBox control but not when I use the global handler.  Any ideas as to why it doesn't get hit when doing it this way?

Display name of months on x-axis in a chart

Could you please let me know if there is any expression which can be used to display the months on x-axis of the column chart. I've tried playing with the Axis option trying to change the interval type to "months" but it is not giving the result. Thank you.

Getting Users who logged on in last month

Hi all, Using Sql Server 2005. Is it possible to retrieve from Sql Server the name and times of all users who logged into the server in the last month? Regards Melt

Hiding other month dates in ASP .Net Calendar Control

Often we need ASP .Net calendar control in our webpages. Most of the times we require navigation in between dates of the calendar control but there can be a requirement that when we want that users should not be able to select dates from month other than the current month.Some people might be thinking in mind that Microsoft has provided theShowNextPrevMonth property of a calendar control which can be set to false in order to disable the navigation in between months. Ok, this will disable navigation but what about the dates of adjacent months shown in current month?Following is the output of a normal Calendar control when ShowNextPrevMonth is not set to false.Note the red circles in above image. July and September will allow you to navigate through other months and red circles below will allow you to select dates of adjacent months.Ok now we set the ShowNextPrevMonth property to false and see the output. Following is the output in this case.So setting out the ShowNextPrevMonth property has disabled the July and Septemberlinks but dates of adjacent months are still there which can be selected as well. How to disable/hide these? Unfortunately there is no such default property provided using which one can disable or hide these dates but fortunately doing this using code is not a complex task. Use following code a

How to schedule activity loaded from external source inside NativeActivity

I have a NativeActivity that takes an InArgument<int> that is the primary key of some table that contains a piece of xaml. When the activity runs, it loads the xaml from the database and uses ActivityXamlServices to turn the xaml into an activity. Then I try to schedule the activity using NativeActivityContext.ScheduleActivity. This fails with the message: The provided activity was not part of this workflow definition when its metadata was being processed.  The problematic activity named 'Sequence' was provided by the activity named 'RunWorkflowFromStore'. This makes sense because I never added the activity I'm trying to run to the metadata. However, when can I do that? It is only at runtime that I know the value of the primary for the xaml I'm trying to load. Or am I doing this the wrong way? Here is my code: public sealed class RunWorkflowFromStore : NativeActivity<ApprovalState> { private Activity _activity; public InArgument<int> WorkflowId { get; set; } protected override void CacheMetadata(NativeActivityMetadata metadata) { var workflowIdArgument = new RuntimeArgument("WorkflowId", typeof(int), ArgumentDirection.In); metadata.Bind(WorkflowId, workflowIdArgument); metadata.AddArgument(workflowIdArgument); } protected override void Execute(NativeActivityContext context) { // Load activity
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