WMI error in SQL Configuration Manager

   Today I spent a couple hours wracking my brain over an error I received in the SQL Reporting Services Configuration Manager: "A WMI error has occurred and no additional error information is available". Without much luck searching Google in finding an answer, I decided to try the basic fundamentals in solving errors for complete noobs, checking if things are installed / running, etc. Then I realised that my SQL Server 2005 Database instance was SP2 and SQL Reporting Services was installed only as SP1. The error resulted in the fact that I had incompatible versions installed.

   I was able to solve this issue by downloading Microsoft SQL Server 2005 Service Pack 2 and installing it against my instance of SQL Reporting Services.

   This goes out to all my other programming comrades out there. :-) Let me know if this did the trick for you or not!

Tags: C#, .net, Reporting Services, Microsoft



DataTable.Compute() Method

   If any of you have worked with the .net DataGrid from Visual Studio 2003, then right off the bat I am going to say sorry. I am personally not a huge fan of it and whenever I use it, it results in a lot of frustration and a few muttered choice words. I'm sorry, but I'm so in love with the Infragistics UltraGrid that I haven't had time to really get involved with the MS DataGrid. Anyway, I digress.

   A client of mine had made a request to take the total of a column from the MS DataGrid and in turn, spit it out into a TextBox. Alright... So my first reaction was to loop through each individual record in the grid. It would have worked, but it would not have been pretty, nor speedy by any means. Then I got to wondering if the DataGrid itself had means of calculating the total of a column. I did some quick research on the subject and alas, I could not find a total for the DataGrid. From there I got to thinking, "Well, if the grid is really just an interpretation of it's DataSource, maybe I should be looking at the DataTable?"

Bingo.

   I would like to present to you DataTable.Compute! With this Method, you are able to return a result you are looking for by using simple DataColumn Expressions. In my instance, I wanted to return the sum of one Column. In order to get this result, here's what I had dumped into the TextBox:
textBox1.Text = "$" + dtPurchases.Compute("SUM(Amount)", string.Empty).ToString();
   I was able to successfully return the total Amount from the grid. Classy! From here, you could even expand the functionality of the Compute method and use the second input to filter your results. Say we wanted to return only Billy's results, we could do so by easily searching specifically for their results:

textBox1.Text = "$" + dtPurchases.Compute("SUM(OrigEquityAmt)", "UserName = 'Billy'").ToString();

 

   Excellent! This is quite a time saver compared to older grid totalling methods, such as looping through each row, accumulating the total of a column. I believe it's also a lot more efficient than querying the sum apart from the grid results from a SQL Database. Regardless of how you want to look at it, DataTable.Compute sure saved me a little trouble!

Tags: Technology, .net, Microsoft, DataTable



ASP.Net URLMappings

Alright, Still in process of tweaking my blogging tool, Europa, for SEO success. One of the points on the list from Chris was to make my URL's cleaner. Before today, I was using the standard querystring method of reaching pages. The problem with these, is that search engines have a hard time digesting them (Let alone humans.)

At first, this project of converting my links sounded very tedious. Initially I was thinking I'd have to write some elaborate routine on publishing an HTML page after writing a blog, similar to how blogger does it. Not only would I have to make an HTML page for each blog, but I would have to update the extra content (such as "last 10 blogs") in case I wanted to archive them, keep tabs on a main page, rss feed, etc etc etc. Didn't sound appetising at all.

Dissapointed and overcome by this method, I set on a search to find a nice and easy route. Lo' and behold, Microsoft never ceases to amaze me. URLmappings totally made my life easier. They allow you to set a sort of virtual path to your page, yet, still taking in querystring information.

For example, the link to my recent blog, "Lucky Man". It's original (and working) path is:

The after effect of URLMappings is as follows:

Sweet, huh? All I had to do was create an XML file that is referencable to my web.config file. For example, I have a file called URLMapping.xml. This contains all my URL Maps. Example:

<?xml version="1.0" standalone="yes"?>
<urlMappings enabled="true">
   <add url="~/346/2007/9/27/Lucky-Man.aspx" mappedUrl="~/blog.aspx?bID=346&amp;Blog=Lucky+Man" />
</urlMappings>

 

Now, I reference URLMapping.xml from the Web.Config file of my website:

<configuration>
   <system.web>
      <urlMappings configSource="URLMapping.xml" />
   </
system.web>
</configuration>

 

 

That's all there is to it! So now when I save a blog, it opens the URLMapping.xml into a Dataset, quick add the links and save it back. Couldn't be easier.


Tags: Technology, SEO, URLMappings, Microsoft, C#, ASP.NET, Europa, Blog, Visual Studio