Does DataSetHelper support grouping by MULTIPLE columns?

B

Brian

When I have attempted to use the InsertGroupByInto() method to group by
multiple columns, the DataSetHelper class throws a NullReferenceException
unless I select the Rollup option (which I don't want). I'm trying to group
by 5 columns with only a single aggregate column (count()). When I select
only ONE column to group by, it works fine--when I add any number of
additional columns, it blows up.

Has anyone gotten this to work before?

Thanks,
B
 
S

Scot Rose [MSFT]

What do you mean by Dataset helper? The Server explorer???

Want to know more? Check out the MSDN Library at http://msdn.microsoft.com or the Microsoft Knowledge Base at http://support.microsoft.com

Scot Rose, MCSD
Microsoft Visual Basic Developer Support
Email : (e-mail address removed) <Remove word online. from address>

This posting is provided “AS IS”, with no warranties, and confers no rights.




--------------------
 
B

Brian

No, the DataSetHelper class referenced in this article:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q325685

I have attempted passing in multiple columns for the GroupBy parameter of
InsertGroupByInto(), but an exception is thrown. This is the call I'm
making:
dsHelper.SelectGroupByInto("Groups", MySourceTable, "Col1, Col2, Col3,
Col4, Col5, Col6, Count(Col7) Quantity", "", "Col1, Col2, Col3, Col4, Col5,
Col6", False)
I am only specifying a single aggregate column and do not want rollups (the
final parameter).

Thanks,
Brian

Scot Rose said:
What do you mean by Dataset helper? The Server explorer???

Want to know more? Check out the MSDN Library at http://msdn.microsoft.com
or the Microsoft Knowledge Base at http://support.microsoft.com
 
S

Scot Rose [MSFT]

Oh Ok, Its not a part of Visual studio, it is a code example. When the article was written the author probably didn't add that functionality. In this particular case, since you have all of
the source code available, you should be able to add the functionality you seek. Do you know what line of the code it is failing in? Does it give any errors when you do not include
the Aggregate column (I saw no support in the code for that If you need it you would need to modify the helper class)

Want to know more? Check out the MSDN Library at http://msdn.microsoft.com or the Microsoft Knowledge Base at http://support.microsoft.com

Scot Rose, MCSD
Microsoft Visual Basic Developer Support
Email : (e-mail address removed) <Remove word online. from address>

This posting is provided “AS IS”, with no warranties, and confers no rights.




--------------------
 
G

Greg Gates

Brian said:
When I have attempted to use the InsertGroupByInto() method to group by
multiple columns, the DataSetHelper class throws a NullReferenceException
unless I select the Rollup option (which I don't want). I'm trying to group
by 5 columns with only a single aggregate column (count()). When I select
only ONE column to group by, it works fine--when I add any number of
additional columns, it blows up.

Has anyone gotten this to work before?

Thanks,
B

I experienced the same problem.
Try the C# version, seems to work better.

http://support.microsoft.com/default.aspx?scid=kb;EN-US;326145

I found what appears to be a small bug in that all columns are
prepended with 'of', even if they are not aggregates. Pretty easy to
fix this.


thanks, Greg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top