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

Top 5 Contributors of the Month
Post New Web Links

Interactive Group Order

Posted By:      Posted Date: September 22, 2010    Points: 0   Category :Sql Server
I have a table with two groups. I want the user to be able to switch the order of the groups interactively. I do it in design time by going to Table->properties->group then switch the order of the groups and it does exactly what I want the users to be able to do but I cant find out :(

View Complete Post

More Related Resource Links

Using Group by and Order By in a Single query


Hi Guys,

I have a requirement to use Group By and Order By in a single query and I used it but the results are not as estimated so I need your help guys

I am writing a query like this

select id, opendate, lastactiondate, (opendate-lastactiondate) as responsetime, ownergroup from ticket group by ownergroup, responsetime, opendate, lastactiondate, id order by opendate

What I am expecting is it will group the results and then order the results in that groups based on the open date but whats happening is opposite it is ordering by opendate first and then grouping if possible

So I see Order By is overriding Group By, is there a waywe can group first and then Order by open date inside that groups

For your Informtion: I am using DB2 Database

Help is appreciated

influence processing order of partitions of measure group



  • a Measoure Group which needs full processing
  • SQL Server 2008 R2
  • the question is regarding performance

The measure group is partitioned by qarter - therefor I have some 30 partitions at the moment. I issue a processFull of the MEasureGroup and let Aanaysis Services Descide the parallelism. In Common it ends up to process between 8 and 12 partitions in parallel (on the 12 Core Machine).

The point is - my partitions growth over time - so older partitions are smaller then newer partitions. Usually Analysis Services ends up starting the newest partition at last - which is the biggest one - and therefore ends up phasing out the processing on a sinle processs (not utilising) the server efficient - because the newest partitions is somehow the biggest and needs the most time - but had nothing to process anymore.

Is there a way to

  • let the server deside the degree of parallelism (like now)
  • but specify the order (lets say start with the newest partitions and end with the oldest)

I have not found anything in the documentation

  • mabe something about processingpriority
  • or just the oder of the process statements in the parallel processing batch - if I would specify them




Interactive Sorting and Group Visibility



I am on SSRS 2008

I have defined groping on my table where the detail row visibility is set to hidden. I also have interactive sorting


now when I expand one of the grouping nodes and then click on interactive sorting. it hides everything again.

What I want is that the sorting should happen on the group which was expended. the view should not be reset.

Randomize order but group similar items together


I have an odd problem. I'm trying to randomize the order in which the rows return, but I need to keep similar items grouped together so I can go through it properly.


Here's a sample table:

<pre>ID  |  Content  |  Answer  |  Correct
 3  |  4+2?    |   6      |   1
 3  |  4+2?    |   4      |   0
 3  |  4+2?    |   5      |   0

 1  |  2+2?    |   4      |   1
 1  |  2+2?    |   3      |   0
 1  |  2+2?    |   5      |   0

 2  |  3+2?    |   3      |   0
 2  |  3+2?    |   5      |   1
 2  |  3+2?    |   4      |   0

It would randomize the order in which the ID's appear and also randomize the order of each answer per ID.

I hope that makes sense.

SELECT ID, Content, Answer, Correct FROM table WHERE ID IN ('1', '2', '3') ORDER BY NEWID() jumbles everything, ideally, I'd like to keep them grouped by their ID's, like this:


Group By and Order By - Help!


Hi all,

I'm developing a small app for use in my work and one of the queries I want to run is to report on records created between certain dates groupped by Technician so we can see which techs are filling in the information and who isn't.

The query I am using is:

SELECT [ID],[Tech],[DateOfWork] FROM [VSR] WHERE [DateOfWork] >= @VAR1 AND [DateOfWork] <= @VAR2 GROUP BY [Tech],[DateOfWork] ORDER BY [Tech],[DateOfWork]

This is telling me I cannot use this query as ID is not part of the Group By clause.  I'm stumped!

Basically I want to get data I can use to produce a report saying:


Tech Name 1:
Between 01/11/2010 and 11/11/2010: 9 VSR Records logged.

Tech Name 2:
Between 01/11/2010 and 11/11/2010: 34 VSR Records logged.

Tech Name 3:
Between 01/11/2010 and 11/11/2010: 1 VSR Records logged.

Between 01/11/2010 and 11/11/2010: 44 VSR Records logged.


Ideally I would need a list of the IDs for the records in each instance so the management can drill down to see the records.

Any help is appreciated.



Mark Young www.tip2tail.co.uk || mark@tip2tail.co.uk

Problem to group radio button across gridview rows

In general no one can easily group or make a single selection from radio button list inside gridview rows. There are a lot of way to make a single or unique selection from list. Here i want to share how i can address this problem in the most easiest way. Googling the problem most of the cases i saw the grouping in horizontal way. Thats why i tried to group the radio buttons in vertical manner. Let i have a requirement like below:

Group Calendars in SharePoint 2010

One of the many requests I had in SharePoint 2007 was the ability to place SharePoint Calendars on top of each other like you can in Outlook 2007 saving you having to look at each and work out when the best time is for a meeting.

ListViewControl - how to group items by their value, for eg. date range



I have a table containing courses, columns are 

Name - "Yoga Classes"

DateStart - "2/23/2010"

DateEnd - "2/24/2010"

I am using ListView Control to bind it, is there a way to display them and group them by Month? 

for eg.


Piano Class (10th Jan 2010 - 11th Jan 2010)
Guitar Class (10th Jan 2010 - 11th Jan 2010)


Yoga Class (15th Feb 2010 - 16th Feb 2010)

Thanks for help.



Is it possible with SQL sorted in descending order according to the word?
In Table I shrajeno Mastercard, Visa, Diners etc ...

All Visa are the first in the order, another Mastercard, etc. ...

Something does not work: ORDER BY PaymentType = 'Visa';

I would not want to work in one field PaymentId (111,222,33, etc. ..) and then use the ORDER BY.

Is this possible in such a way?

Linq qry with order by basic questions


I have never tried a group by with linq, now I do and I'm stuck.

I try to convert this sql statement to its linq counterpart :

SELECT COUNT(tb_Mailer_Smses.Id) AS [cnt], tb_Mailer_mailing.Id As [Id]
,SUM( CASE WHEN tb_Mailer_smses.DLRStatus = 200 THEN 1 ELSE 0 END) As [Delivered]
FROM tb_Mailer_mailing INNER JOIN
tb_Mailer_Smses ON tb_Mailer_mailing.Id = tb_Mailer_Smses.MailingId
WHERE tb_Mailer_mailing.ApplicationId = 1
GROUP BY tb_Mailer_mailing.Id

Is there some one who can me show me the convertion process ?

How do I get the emails of all the members of a given group in ActiveDirectory - Need help



  I have a need to send out emails to all the people who are in a given group say "HR Department". I need to be able to get all the emails through a for loop and then as it retrieves I should send emails to them. Can some one please help me with the code

this is what I came up with but not sure how to go about writing a for loop to get all the emails in the given group.

public static string SendEmails(string loginName)
        string Department = "HR Department"
        string userName = ExtractUserName(loginName);
        DirectorySearcher search = new DirectorySearcher();
        search.Filter = String.Format("(SAMAccountName={0})", userName);
        //search.Filter = String.Format("(SAMAccountName={FAY ImprovmentForm})", userName);
        //LdapSearcher.Filter = string.Format("(&(objectClass=user)(department={0}))", Department); 
        //search.Filter = string.Format("(&(objectClass=group)(SAMAccountName=" + Department + "))", userName);

Need Help in LINQ query for group By with chunks of record


I am assigning and unique id [strShipperIdSequence] on my List on bases of some properties which are grouped together uniquely.
Now what i needed is that my group should be further break down to some maximum amount of chunks.[Let say 10]
that mean's even i am having Same value in 12 records i should get 2 groups[I of 10 items and other of 2 items]

var uniqueGroups = objMdbContentInfoList.GroupBy(p => new
}).Select(g => g.First()).ToList();
foreach (var objUnique in uniqueGroups)
string strShipperIdSequence = APIGlobalMethods.GetShipperRequestID();
foreach (MdbContentInfo obj in objMdbContentInfoList.FindAll(h => (h.CON_ENTRY_POINT == objUnique.CON_ENTRY_POINT &&
h.APPTType == objUnique.APPTType &&

Dynamic .NET: Creating Interactive Bing Maps with Silverlight and IronRuby


Silverlight provides support for dynamic languages such as IronRuby and IronPython. We'll walk you through the creation of a custom Silverlight control using Bing Maps and IronRuby.

Ashish Ghoda

MSDN Magazine February 2010

Test Run: Group Determination In Software Testing


There is a large body of research on group techniques to determine the best alternative from a set of options. Dr. James McCaffrey outlines five of them.

Dr. James McCaffrey

MSDN Magazine November 2008

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