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


Post New Web Links

Strange sorting behaviour on series groups

Posted By:      Posted Date: October 08, 2010    Points: 0   Category :Sql Server
 

Hi guys

I'm seeing some very strange behaviour when trying to sort my series groups on a chart.

I have an Analysis Services dataset with Job Grades and Job Grade Codes, the job grade simply being a concatenation of the Job Grade and the word "GRADE", e.g.

1 |  GRADE 1

2 |  GRADE 2

3 |  GRADE 3 etc.

I've pulled in the field Job_Grade into my Series groups section for a chart. I then tried to sort it by the key value which is the Job_Grade_Code like this:

=Fields!Job_Grade.Key

This produced the following result:

 Grade 6

Grade 7

Grade 8.....

Grade 4

Grade 5

I noticed that the sorting was incorrect. I noticed that in the source the Job_Grade_Code field was a varchar value, so I changed the sorting expression to the following:

=Cint(Fields!Job_Grade.Key)

This however made no difference and still sorted my grades in the incorrect order


View Complete Post


More Related Resource Links

GridView Sorting/Paging : 'REAL' AJAX with Asp.Net Series

  
This is a continuation of my 'REAL' AJAX with Asp.Net (not Asp.Net AJAX) series posts for those of us trying to stop relying on Asp.Net 'AJAX'.

Ok, nothing too dramatic to start things off, we are going to make some tabled data sortable and pagable all without using a bit of postback. Not only that, but it is going to be incredibly easy!

ASP.NET DateTime Conversion strange behaviour

  

Hi,

I am working on ASP.NET web application where we are using javascript calendar to accept the date in textboxes. The date format is dd/mm/yyyy. The application is running in US and UK environments.

I am facing issues in US environment while storing the dates so I have added 2 keys in config file viz culture which will be either en-US or en-GB depending on the deployment location and baseCulture which will always be en-GB.

In the code, I have added a condition which checks if culture and baseCulture values are not matching then do the conversion of date in US format.

But I have found that the code converts the date from dd/mm/yyyy to mm/dd/yyyy when the key is baseCulture (en-GB) and it throws FormatException when key is culture (en-US).

I am bit confused by this behaviour. Is this normal? Can any one please explain more about this? Note: I am working on a machine which has en-US as language and culture

<add key="culture" value="en-US" />
<add key="baseCulture" value="en-GB" />
// This line works and converts the date from 26/08/2010 to 08/26/2010
// Here the baseCulture is en-GB.
DateTime dt = DateTime.Parse(txtCurrentDate,baseCulture)

// This line throws FormatException. culture 

VERY strange behaviour of IE7 and 8!

  
Today is a day where nothing seems to work out as expected.I'm currently making the HTML and Javascript templates for our new Corporate Page.The thing works as expected in Firefox, Opera, Chrome and IE 6, but not in IE 7 and 8!The "thing" is a menu/submenu written by me in javascript.The way it looks in Firefox etc:The way it looks in IE 7 and 8:There is absolutely no explanation for the strange "rounded" edge on the right and the gradient going over it.The background is a semi-transparent optimized PNG without color profiles which shows up gray in IE 6 and transparent in the other browsers - as expected.On my other developer's computer, it shows up perfectly in both IE 7 and 8.What could possibly create this behaviour?----source:<div class="subMenusContainer"> <div class="subMenu" id="aboutUsMenu"> <a href="/Home/AboutAurora">About AURORA</a> <a href="/Home/AboutErichKrammer">Erich Krammer</a> <a href="/Home/AboutFoundation">AURORA Foundation</a> <a href="/Home/AboutPartners">Partners</a> <a href="/Home/AboutCareers">Careers</a> <a href="/Home/AboutContact">Contacts</a> </div> [snip] <div class="subMenu&q

Strange behaviour of a query using a recursive CTE

  
Hi, I have a problem with a query. The situation is a bit complicated but I'll try to explain it the best I can. Short story: I have a .NET application that executes a recursive query (using CTE) and then uses a DataReader to read each row's each field one-by-one using the GetValue() method. With specific parameters this query behaves quite fast but with other parameters it can take more than a second to read a row's field (instead of the usual ~0.00001 second). Long story: The database: I have 4 tables with the following columns: 1. Entity table: Id (int), Version (bigint), InternalName (nvarchar(255)), ExternalName (nvarchar(255)), Description (nvarchar(2,000)). 2. Relation table: Id (int), Version (bigint), EffectiveStartTime (datetime), EffectiveEndTime (datetime), ParentEntityId (int), ChildEntityId (int), Ordinal (int). 3. Property table: Id (int), Version (bigint), InternalName (nvarchar(255)), ExternalName (nvarchar(255), Description (nvarchar(2,000)). 4. EntityProperty table with 10,000 rows: Id (int), Version (bigint), EffectiveStartTime (datetime), EffectiveEndTime (datetime), EntityId (int), PropertyId (int). The Entity table has 100,000 rows, the Relation table has 100,000 rows (each entity has a relation), Property table has 22 rows and the EntityProperty table has 2,010,000 rows (properties with Id from 1 to 20 are assigned to all entities and properties with

Strange behaviour of a query using a recursive CTE

  
Hi, I have a problem with a query. The situation is a bit complicated but I'll try to explain it the best I can. Short story: I have a .NET application that executes a recursive query (using CTE) and then uses a DataReader to read each row's each field one-by-one using the GetValue() method. With specific parameters this query behaves quite fast but with other parameters it can take more than a second to read a row's field (instead of the usual ~0.00001 second). Long story: The database: I have 4 tables with the following columns: 1. Entity table: Id (int), Version (bigint), InternalName (nvarchar(255)), ExternalName (nvarchar(255)), Description (nvarchar(2,000)). 2. Relation table: Id (int), Version (bigint), EffectiveStartTime (datetime), EffectiveEndTime (datetime), ParentEntityId (int), ChildEntityId (int), Ordinal (int). 3. Property table: Id (int), Version (bigint), InternalName (nvarchar(255)), ExternalName (nvarchar(255), Description (nvarchar(2,000)). 4. EntityProperty table with 10,000 rows: Id (int), Version (bigint), EffectiveStartTime (datetime), EffectiveEndTime (datetime), EntityId (int), PropertyId (int). The Entity table has 100,000 rows, the Relation table has 100,000 rows (each entity has a relation), Property table has 22 rows and the EntityProperty table has 2,010,000 rows (properties with Id from 1 to 20 are assigned to all entities and properties with

WPF - strange context menu behaviour

  

Hi 

I create contextmenu using that code

 

 protected MenuItem itemAdd, itemDelete, itemSelectBranch, itemDeleteClasp;
  protected MenuItem itemCut, itemCopy, itemPaste, itemAddParent, itemPasteWithChildren;
  protected MenuItem itemAddTask, itemAddExtTask, itemAddMileStone;
 menu = new ContextMenu();
    itemAdd = new MenuItem
           {
             HorizontalAlignment = HorizontalAlignment.Left,
             HorizontalContentAlignment = System.Windows.HorizontalAlignment.Stretch,
             Header = "Add"
           };
    itemDelete = new MenuItem
             {
               HorizontalAlignment = HorizontalAlignment.Left,
               HorizontalContentAlignment = System.Windows.HorizontalAlignment.Stretch,
               Header = "Delete"
             };
    itemSelectBranch = new MenuItem
    {
      HorizontalAlignment = HorizontalAlignment.Left,
      HorizontalContentAlignment = System.Windows.HorizontalAlignment.Stretch,
                  Header = 

Strange validation behaviour on dynamically created controls

  

I'm trying to debug an application which generates a fixed number of questions from a database of 20 questions, and validate them on button click. On postback, I want the incorrect questions to be labeled red. However, all the questions are labeled red on postback. I'm almost positive that the problem is with "page_init" and "page_load",  I'm using session variables to keep track of the question IDs and invalid questions. Any help is appreciated.

Here is the sample code.

Protected Sub Page_Init(ByVal s As Object, ByVal e As EventArgs)
       dim i as integer
       if Not Page.IsPostBack then
           // generates a random integer array for loading the questions
       For i = 0 To 1  // I'm only loading two questions 
           extract_question(selected_array(i))   
        Next
        else     
              //extract_question queries the database and load the controls dynamically
               extract_question(CInt(session("check_0")))  
               extract_question(CInt(session("check_1")))           
         end if      
       end if 
    
    End Sub

Protected Sub Page_Load(ByVal s As Object, ByVal e As EventArgs)
        If page.IsPostBack then
         dim textlabel as string
            dim sessionvar as string
            dim sessionc

Very strange behaviour from WPF binding

  

 

I am currently using markup like the following:

 <Binding diagnostics:PresentationTraceSources.TraceLevel="High" RelativeSource="{RelativeSource Self}" Path="(PatientControls:Entity

Strange Behaviour of For Loop

  

Hi Friends,

I am getting Strange behaviour from the for loop.

Here is the loop

for(i=1, i<=1000000, i++)

{

label1.text = string1;( string 1, 2 , 3 comming from logic)

label2.text = string2;

label3.text = string3; 

label4.text = string4;

once i got them i storing in the table of sql server using following steps,

SqlConnection conn = new SqlConnection();
                     conn.ConnectionString = " connectionstring ";
                     SqlCommand cmd = new SqlCommand();
                     cmd.CommandType = System.Data.CommandType.Text;
                     cmd.CommandText = "INSERT INTO table(value1, value2, value3, value4, value5) VALUES( @i, @value1,@value2,@value3,@value4)";
                     cmd.Parameters.Add(new SqlParameter("@i", i ))

SSAS: Strange filter behaviour in client

  

Hi,

 

In my cube I have one Time dimension that I use for filtering my data. The way I select my check boxes in the Time dimension influences the shown data. I checked the created filter by using SQL Server Profiler and this shows that the created filter is totally wrong!

 

Scenario 1 (NOK)

 

Steps

·        

Strange behaviour taxonomy filter in content query webpart on anonymous website

  

We are experiencing strange behaviour on a publishing facing website implemented in SharePoint 2010.

The story
We use a (default) Content Query Webpart to show related information in relation with the current page. The filter is using a field value (UserFieldValue) of the current page and filters other pages which have the same tags. The fields, on the current page and the related pages, are taxonomy field. Everything works fine!

We published the pages, looked at the website as an anonymous user and everything was still going smoothly. We went home, slepts an hour of 6, waked up. Proudly checked our beatifull new website :). Ahhhhh, what is this.. all content query webpart with the filters on the taxonomy field returned exactly nil.

We logged in to our website, checked if the pages where published, and well, they are... Just published them again. And everything looked fine again.... but not for long. Exactly the next day (... app pool recycle ...) the same problem ...

Logged in again to our website, logged out...  problem solved.... till the next apppool recycle.

My conclusion
Until the firrst authenticated visit to the page the taxonomy filter on the content query webpart silenty fails.

Resolution
As a "temporary" workarround we have created a sc

Extending OutputResponseStream but some strange behaviour???

  

Hi

I have trying to write a HttpHandler to Filter some content before rendering. As HttpApplication.Context.Response.OutputStream does not support manipulatiing at this stage. so, for remedy i am extending it to customize Write method

here is the code

using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.IO;
using System.Text.RegularExpressions;

namespace WebApplication1
{
    public class StdViewStateRemover : System.Web.IHttpModule
    {
        private System.Web.HttpApplication mApplication;

        public StdViewStateRemover()
        {
        }

        public void Init(System.Web.HttpApplication application)
        {
            // Wire up beginrequest
            application.BeginRequest += new System.EventHandler(BeginRequest);
            // Save the application
            mApplication = application;
        }

        public void BeginRequest(Object sender, EventArgs e)
        {
            //for testing purposes i just checking jpg images
            if (((HttpApplication)sender).Request.Path.ToLower().Contains("jpg".ToLower()))
            {
                return

ListBox with a Canvas, strange selection behaviour

  

Hello,

 

I have a Listbox with a Canvas asigned to the ItemsPanelTemplate:

<ListBox x:Name="CanvasListBox" SelectionMode="Multiple" SelectionChanged="CanvasSelectionChanged">
	<ListBox.ItemsPanel>
		<ItemsPanelTemplate>
			<Canvas />
		</ItemsPanelTemplate

Strange behaviour of VS 2010 in ASP.NET Dynamic data web App

  

I noticed this while i was working on asp.net dynamic data web app. It made me go crazy as I struggled quite a lot of time why this error was coming.

Basically, I have some of the custom page templates added to my application. I observed that if I keep these custom pages say /DynamicData/CustomPages/Employees/Details.aspx opened in the designer, I always get following error when i try to run the app.


Server Error in '/' Application.

The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

Requested URL: /DynamicData/CustomPages/Employees/Details.aspx


I did not understand the logic behind this. In order to confirm, i created a simple web app with dynamic data and still this error occurs. In fact, the same error also occurs if you keep any of the default page templates opened in your designer.


Thought

Strange behaviour of ModalPopupExtender when used with IE 8

  

Hi,

I am facing strange issue with Modalpopupextender when used with IE 8. My client is upgrading IE 6 to IE 8 and I am seeing some compatibility issue where the modal popup shifts the background screen to the bottom and to show the processing message. I can still see the background screen upon scrolling down and the screen is still enabled for user acxtion.

This same pience of code is working properly in IE 6 where the modal poupup opens on top of the background screen covering the complete background with gray color whicd restricts user for doing any kind of action until the processing completes.

 

Below is code I am using. Any kind of help is highly appreciated.

<

body>

 

<form id="form1"

Locbaml strange behaviour

  

Hi Guys,

  While i am using locBaml to generate resource file from csv file, i had the folowing error:

  Each row must have the 2nd column as the key to the resource.

  My command for generation is:

  locbaml /generate AuthoringMain.resource.dll /trans:c:\resource\text1.csv /out:c:\ /cul:zh-CN

 I do not find anything worng with it?

 Any ideads?

Thanks!

 

 


show customized groups in series field in a stacked bar chart

  

Hi,

Here I have one doubt, need your help.

I am creating a stacked bar chart in report designer, and I have created the Dataset.

For instance: I drag and drop Count to data field, year to the category field, createdby to the series field. Now I assume that createdby have values: v1,v2,v3,v4,v5,v6. I want to group v1,v2 into Value1, and show in green color; meanwhile group v3,v4,v5 into Value2, show in red color. and do not show v6.

In the final stacked bar chart, I want only Value1 and Value2 shown in series field.

Can you tell me how can I filter v6 and create the two groups? thanks!

Regards.


Connie Zhu
Categories: 
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