OK, right this one up under lame fixes.
This is the setup: WinForms with a TreeView and an ImageList. What happens: no images in the TreeView. Totally blank!
The culprit: Application.EnableVisualStyles.
If your Main() looks like this:
Application.EnableVisualStyles(); Application.Run(new frmMain());
You will not see Images in your TreeView no matter how hard you try.
But change it ever so slightly to this:
Application.EnableVisualStyles(); Application.DoEvents(); Application.Run(new frmMain());
and everything is hunky dorry.
BTW: I take no credit in figuring this out. I actually found the fix in the Microsoft .NET VB Forums.
March 28, 2006
March 24, 2006
MS OLAP 2005: DrillThru
So the Boise Code Camp 1.0 was last week. I gave a presentation on using ADOMD.NET 2.0. Very basic demonstration: how to open a connection, how to browse a cube/dimension/hierarchy/level/members/etc, how to execute a command, how to display the command via the CellSet object, why to avoid the AdomdDataReader, etc.
But, as is standard, I received one question I could not fully answer: "Hey, I heard they (Microsoft) removed Drill Thru from 2005 (Analysis Services 2005). Is that true?"
My stock answer was: “No, it is there.” Drill Thru is too needed a feature to just remove on the spur of the moment (a new release). I even opened a cube browser to show that drill-thru worked. And I was right -- or, mostly right anyway.
I did some stumbling around the web (read: google search) and I found this article: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql90/html/sql2k5_anservdrill.asp
Read it if you wish, I can wait. The jist of the article is this, Drill Thru is there in 2005, and turned on by default, but it is different now -- ever so slightly different.
In the olden days of MSOLAP 2000 when you performed a Drill Thru, Analysis Services would send a SQL query back to the source database asking for data, and then passing that data back to the client. And that worked well, it was often horribly slow (especially against non-MSSQL databases, but it worked. Oh, and as a bonus feature, you could select which columns were displayed to the user, but not the order. Yup, that was fun. “Why is the Product ID in the middle of the display? Well the OLAP gods just wanted it there, that’s all. Move it? Shhhhhh, they might hear you!”
Now, in 2005, it seams that Analysis Services does not go back to the source database at all. Instead it returns data from the inner darkness of the cube itself. The side caveat is that if you want to have some data available via Drill-Thru, it has to be available IN the cube. Uhm, minor change there – better read the article above.
How can this possibly be a good thing? That is an easy question. If you are creating a MOLAP cube off of a live database (not a data warehouse that is built right before you build the cube), you should always get matching data between the cube and the drill-thru. Whereas in 2000, there was always the risk that the data might be out of sink between the database and the cube, causing inconsistencies between the drill-thru results and the cube. And trust me, if the cube says there are 5 of something and the drill-thru shows 6, people will notice.
A couple of good things did come out of this new version though: instead of having one drill-thru option per cube (select your columns and go away), now you can specify which the drill thru options on a measures by measure basis. This is because all drill-thrus are now handled by cell level actions.
This is something that many of us talked about when cell level actions became available in 2000 by way of one of the services packs (sp2 or sp3, I don’t remember). If any of the 3rd party tools had implemented it, things would have been cool. Note: I’m sure the VERY first question I would have received would have been: “Can you put the results straight into Excel?” (sigh) You might be wondering if I’m trying to be funny there (yes and no), but I also know that the first remark once I was done would have been: “Why is it so darned SLOW?” (sigh)
Another new toy in Analysis Services 2005 is a Report Action. This is an action that loads up a specific Report Server report. You can even key off of a cell. But I’m not sure if Report Server is really ready for all of the options needed for true drill-thru yet – mostly because of parameter limitations. But this would be perfect for a number of options where a limited set of filters is a viable solution.
So where does that leave us? A bit further than where we were in 2000. We can now specify drill-thru options on a per measure basis, and we have multiple drill-thru options, we can even create a Report Server report to do some limited drill-thru.
But customers will still want to get more out of their drill-thru: contextual information, links to other systems, related documents, etc. It isn't just about the raw data anymore to give the customers a full view of what there is to know (I've had to help write two drill-thru web sites because the customers did not like the standard output). I fear I will still be creating custom drill-thru web sites for a while to come. I guess I should be happy about that.
But, as is standard, I received one question I could not fully answer: "Hey, I heard they (Microsoft) removed Drill Thru from 2005 (Analysis Services 2005). Is that true?"
My stock answer was: “No, it is there.” Drill Thru is too needed a feature to just remove on the spur of the moment (a new release). I even opened a cube browser to show that drill-thru worked. And I was right -- or, mostly right anyway.
I did some stumbling around the web (read: google search) and I found this article: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql90/html/sql2k5_anservdrill.asp
Read it if you wish, I can wait. The jist of the article is this, Drill Thru is there in 2005, and turned on by default, but it is different now -- ever so slightly different.
In the olden days of MSOLAP 2000 when you performed a Drill Thru, Analysis Services would send a SQL query back to the source database asking for data, and then passing that data back to the client. And that worked well, it was often horribly slow (especially against non-MSSQL databases, but it worked. Oh, and as a bonus feature, you could select which columns were displayed to the user, but not the order. Yup, that was fun. “Why is the Product ID in the middle of the display? Well the OLAP gods just wanted it there, that’s all. Move it? Shhhhhh, they might hear you!”
Now, in 2005, it seams that Analysis Services does not go back to the source database at all. Instead it returns data from the inner darkness of the cube itself. The side caveat is that if you want to have some data available via Drill-Thru, it has to be available IN the cube. Uhm, minor change there – better read the article above.
How can this possibly be a good thing? That is an easy question. If you are creating a MOLAP cube off of a live database (not a data warehouse that is built right before you build the cube), you should always get matching data between the cube and the drill-thru. Whereas in 2000, there was always the risk that the data might be out of sink between the database and the cube, causing inconsistencies between the drill-thru results and the cube. And trust me, if the cube says there are 5 of something and the drill-thru shows 6, people will notice.
A couple of good things did come out of this new version though: instead of having one drill-thru option per cube (select your columns and go away), now you can specify which the drill thru options on a measures by measure basis. This is because all drill-thrus are now handled by cell level actions.
This is something that many of us talked about when cell level actions became available in 2000 by way of one of the services packs (sp2 or sp3, I don’t remember). If any of the 3rd party tools had implemented it, things would have been cool. Note: I’m sure the VERY first question I would have received would have been: “Can you put the results straight into Excel?” (sigh) You might be wondering if I’m trying to be funny there (yes and no), but I also know that the first remark once I was done would have been: “Why is it so darned SLOW?” (sigh)
Another new toy in Analysis Services 2005 is a Report Action. This is an action that loads up a specific Report Server report. You can even key off of a cell. But I’m not sure if Report Server is really ready for all of the options needed for true drill-thru yet – mostly because of parameter limitations. But this would be perfect for a number of options where a limited set of filters is a viable solution.
So where does that leave us? A bit further than where we were in 2000. We can now specify drill-thru options on a per measure basis, and we have multiple drill-thru options, we can even create a Report Server report to do some limited drill-thru.
But customers will still want to get more out of their drill-thru: contextual information, links to other systems, related documents, etc. It isn't just about the raw data anymore to give the customers a full view of what there is to know (I've had to help write two drill-thru web sites because the customers did not like the standard output). I fear I will still be creating custom drill-thru web sites for a while to come. I guess I should be happy about that.
March 23, 2006
Trinity is Crawling
OK, this is not a programming related post. My bad, get over it.
But, my youngest daughter, now 10 months old just started crawling. Even better, I just caught the entire thing on tape. This is a momentous event, for all of you without kids and don't know better. This means the games have begun.
From the time a child starts crawling it is as if a silent gun has shot off for an Olympic 100 meter dash. Another analogy would be for a back woods car race. Doing the dashing is the parents and the baby, each trying to out maneuver each other to the best lanes. Unfortunately only the baby knows where those are, and it is up the parent to find them out -- preferably before the baby does.
How is the baby going to get to the stairs (we have lots of them), which electric sockets are exposed, which of the older kids toys are chocking hazards, etc. You see, this isn't something you can do once and you are good for life.
In the world of computer security, people are always wishing for more security, but gripe to high heaven when they have to enter a new password. It is annoying. Same with child proofing a house. Yes you can do it. But all of the stairway gates, drawer locks, and electric socket covers get really annoying really fast. So as soon as your kid gets old enough -- off they go! Of course, that is also when you find legos jammed in the electric sockets...again. So when the next baby comes around, there you go again. Reapplying old security fixes, and adding new ones.
That is enough analogies for one night.
But, my youngest daughter, now 10 months old just started crawling. Even better, I just caught the entire thing on tape. This is a momentous event, for all of you without kids and don't know better. This means the games have begun.
From the time a child starts crawling it is as if a silent gun has shot off for an Olympic 100 meter dash. Another analogy would be for a back woods car race. Doing the dashing is the parents and the baby, each trying to out maneuver each other to the best lanes. Unfortunately only the baby knows where those are, and it is up the parent to find them out -- preferably before the baby does.
How is the baby going to get to the stairs (we have lots of them), which electric sockets are exposed, which of the older kids toys are chocking hazards, etc. You see, this isn't something you can do once and you are good for life.
In the world of computer security, people are always wishing for more security, but gripe to high heaven when they have to enter a new password. It is annoying. Same with child proofing a house. Yes you can do it. But all of the stairway gates, drawer locks, and electric socket covers get really annoying really fast. So as soon as your kid gets old enough -- off they go! Of course, that is also when you find legos jammed in the electric sockets...again. So when the next baby comes around, there you go again. Reapplying old security fixes, and adding new ones.
That is enough analogies for one night.
March 13, 2006
Funny: best languages to learn
The best writing, to me anyway, is usually 1. something that you can learn something from, 2. funny, and 3. pragmatic.
This blog entry is all three with a discussion on the best languages to learn:
http://www.cabochon.com/~stevey/blog-rants/tour-de-babel.html
The only fault that I have: it doesn't list Delphi or C#. :)
This blog entry is all three with a discussion on the best languages to learn:
http://www.cabochon.com/~stevey/blog-rants/tour-de-babel.html
The only fault that I have: it doesn't list Delphi or C#. :)
March 11, 2006
Winforms 2.0: Application Settings
OK, I'm defiantly getting behind the times. But in my defense, I don't get many chances to use WinForms these days -- I'm still waiting for my great excuse to use Click-Once.
What did I miss all this time: Application Settings. This is not entirely new, we have had app.Config for a long time now, and the Settings class/designer uses the app.Config.
Couple of differences though:
To add a settings class to a C# project: Right click on the project (like you do to add a class or a form), select Add->New Item.... Then select Settings File from the bottom of the list, and give it a name -- I called mine Settings1.
That produced a file called Settings1.settings in the designer.
To access the properties stored in the settings class, I use Settings1.Default..
Also, you can access the code behind the designer for the settings object. Be warned, it is generated code, and it will get overwritten from time to time.
There are some differences between the VB version of this and the C#, but those are documented in the source. The main difference is that the settings class is included in the My object, and C# has to use the method shown above. This is complicated by the fact that most of the documentation seems to cater to the VB crowd.
One final note that has to be looked into. All of the settings in the Settings class are ultimatly stored in the app.config file. Application level settings are stored in the node, and user settings are stored in the node.
Now how does that work for multiple users?
What did I miss all this time: Application Settings. This is not entirely new, we have had app.Config for a long time now, and the Settings class/designer uses the app.Config.
Couple of differences though:
- It is type safe. You add a property thru the designer, then you can access that value thru its property. Nice. (I'll show more on this in a minute)
- You can change the values, and there is a Save method!
- There is a setting for User vs. Application settings
To add a settings class to a C# project: Right click on the project (like you do to add a class or a form), select Add->New Item.... Then select Settings File from the bottom of the list, and give it a name -- I called mine Settings1.
That produced a file called Settings1.settings in the designer.
To access the properties stored in the settings class, I use Settings1.Default.
Also, you can access the code behind the designer for the settings object. Be warned, it is generated code, and it will get overwritten from time to time.
There are some differences between the VB version of this and the C#, but those are documented in the source. The main difference is that the settings class is included in the My object, and C# has to use the method shown above. This is complicated by the fact that most of the documentation seems to cater to the VB crowd.
One final note that has to be looked into. All of the settings in the Settings class are ultimatly stored in the app.config file. Application level settings are stored in the
Now how does that work for multiple users?
March 08, 2006
ClickOnce in FireFox
OK, here is something I have been waiting for: an article detailing how to run a .NET 2.0 ClickOnce application from FireFox.
http://blogs.msdn.com/saurabh/archive/2006/03/02/541988.aspx
We are going to have to see a presentation on this one at the local user group meeting, me thinks.
http://blogs.msdn.com/saurabh/archive/2006/03/02/541988.aspx
We are going to have to see a presentation on this one at the local user group meeting, me thinks.
March 07, 2006
FireFox 2.0 with Spell Check
So the Alpha 1 of FireFox is supposed to be out this week. The big feature that I am looking for: as-you-type-Spell-Check.
Sure there are other cool features: better rss/atom support, tab enhancements, blah-blah-blah -- SPELL CHECK -- yay, yay!
Things that are not there: built in bittorrent would be nice. So would built in pod-cast support. Oh well, that is what extensions are for.
Sure there are other cool features: better rss/atom support, tab enhancements, blah-blah-blah -- SPELL CHECK -- yay, yay!
Things that are not there: built in bittorrent would be nice. So would built in pod-cast support. Oh well, that is what extensions are for.
Subscribe to:
Posts (Atom)