December 31, 2008
Microsoft AJAX Library Essentials is a book intended for ASP.NET developers who want to dive into client side programming and take full advantage of the Microsoft AJAX Library.
The book opens up with a brief history of the internet, http, and html. This chapter serves as a refresher for web programming veterans, or valuable information for beginners. Also provided for beginners are instructions for setting up your programming environment so you will be able to follow and try out the example code.
Next you are taken on a whirlwind tour of HTML, CSS, JavaScript, and the DOM and see examples of handling AJAX requests using XMLHttpRequest. If you have ever done any AJAX on your own (without the use of a library or framework), you could easily skip this entire chapter, if you have not, it is a wonderful tutorial on what goes on behind the scenes, and you get to see the inner workings that the libraries and frameworks provide easier access to.
The book does a very nice job of explaining how OOP principles can be used in JavaScript. I consider myself only an intermediate level JavaScript programmer, and I was able to follow the books explanations of what Closures, Prototypes, and what “this” means in relation to context and scope. For me it was an eye opening look into the potential power of JavaScript, which I have not used for much more than rudimentary AJAX calls and client-side data validation.
The rest of the book serves as a reference complete with code examples of how the Microsoft AJAX Library acts as a framework to make everything it just taught you easier. It shows the namespaces and method names (that will be familiar to Microsoft developers) which you can use in your own javascript code.
All in all, it is a nice reference and guide to using the Microsoft AJAX Library.
Leave a Comment » |
Books |
Permalink
Posted by wulimaster
October 31, 2008
I’ve been using this sort of syntax for a couple of years now to write dynamic where clauses:
SELECT
Col1
FROM
dbo.Table
WHERE
@param IS NULL OR Col1 = @param
Recent application timeouts at my company have us investigating SQL queries for performance issues. One of the things I have discovered is that queries like that one are prone to performance problems. That query example on a table that has 6800 rows in it caused 3869 reads when a the column being compared has an index, and the parameter was not null (query returned 1 row in 253 ms).
For whatever reason, rewriting the query like this:
SELECT
Col1
FROM
dbo.Table
WHERE
(Col1 = @param AND @param IS NOT NULL) OR (@param IS NULL)
The query only causes 106 reads and returns the same single row in 33 ms. I don’t pretend to understand why the query that looks worse and has a more complicated execution plan performs better, but it does. I got the idea to try it from this article
The degree to which the syntax difference helps depends on how the table is indexed, and the column involved. Sometimes that syntax change makes no difference at all. The same article also showed me another trick that works even better for performance, but only works for non-nullable columns and is more complicated because you have to provide appropriate @min and @max values, which may be difficult depending on the data type and data itself:
SELECT
Col1
FROM
dbo.Table
WHERE
Col BETWEEN COALESCE(@param, @min) AND COALESCE(@param, @max)
Leave a Comment » |
SQL |
Permalink
Posted by wulimaster
October 23, 2008
I do this so rarely, that I always forget how to do it. Sometimes in a web application, you reference a class library that uses a web service. The web service is not directly added to the web application, so nothing is in the web.config to override, and since it is a class library versus a web application, you need to add a sectionGroup so you won’t throw the yellow screen of death due to an unknown section “applicationSetttings”.
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="ErrorHandler.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<applicationSettings>
<ErrorHandler.Properties.Settings>
<setting name="ErrorHandler_ErrorLoggingWebService_ErrorLoggingWebService"
serializeAs="String">
<value>http://localhost/errorloggingwebservice/errorloggingwebservice.asmx</value>
</setting>
</ErrorHandler.Properties.Settings>
</applicationSettings>
Leave a Comment » |
ASP.NET |
Permalink
Posted by wulimaster
June 6, 2007
I was searching for some information on the report viewer control, and accidentally stumbled upon something I always wanted, but could not seem to figure out.
A combination of 2 properties will have the control automatically size itself to fit the entire report:
AsyncRendering=false SizeToReportContent=true
The AsyncRendering=false changes the rendering to be in-line instead of a frame, which for whatever reason is required for the SizeToReportContent to work.
A noteworthy side-effect of these settings, is that images that have the “sizing” property set to “AutoSize” do not render correctly. They get shifted and cut off. Changing the sizing to FitProportial cured the rendering problem for me. This was not a property I set myself, so AutoSize must be the default.
3 Comments |
ASP.NET |
Permalink
Posted by wulimaster
April 9, 2007
If you’ve never worked with the report viewer control and the report designer in VS 2005, you should give it a try if you ever have a need for a reporting services report in your web application. Anyway, a colleague of mine at work was working on a report that I designed a few months earlier. Whenever I setup a reporting services report, I use the smart tag to create a datasource to start my design from. The smart tag will create a dataset which is what the report will in theory be bound to. At runtime, I always manually bind to a dataview that I get from a business layer class, and therefore only make use of the dataset name to tie my business class to the report. So in the method I use to run the report, I do something like this:
ReportDataSource rpds = new ReportDataSource();
rpds.Name = "DataSet1_DataTable1";
rpds.Value = dv;
ReportViewer1.LocalReport.DataSources.Clear();
ReportViewer1.LocalReport.DataSources.Add(rpds);
ReportViewer1.LocalReport.ReportPath = @"MyReport.rdlc";
where “DataSet1_DataTable1″ is the name of the dataset / datatable created using the report designer smart tag, and “dv” is the local variable holding a DataView returned by my business class.
Anyway, we had a problem where one of the fields was not displaying on the report. After an hour of scratching our heads, we determined that the field names (columns in the dataview) in the report appear to be case sensitive. Once we had the case of the column name returned by the business class match the case in the dataset, the field would then display on the report. I am not certain if this is a bug with the report designer, or just a strange coicidence that matching the case fixed the problem.
3 Comments |
ASP.NET |
Permalink
Posted by wulimaster
September 20, 2006
Tracking down hardware issues can be challenging sometimes…
About 5 or six months ago I decided to fix some stability problems with my son’s computer. It was blue screening during heavy 3d gaming. I had run some basic diagnostics and found that it was failing certain extended memory tests. So I decided to buy a new DIMM for the machine, and since the case I was using was ridiculously loud, I decided to buy a quieter case at the same time. Read the rest of this entry »
Leave a Comment » |
Hardware |
Permalink
Posted by wulimaster
August 31, 2006
One of the challenges we’ve had at my present company is using CFQueryParam with double-byte characters. Basically, we couldn’t. A recent post on the Phoenix CFUG list prompted me to actually read the live docs on the subject. I found a comment there that pointed out the string format option in the advanced data source settings.
By checking the “String Format” box (the one that says “Enable Unicode for data sources configured for non-Latin characters”) you can now send double byte characters successfully using CFQueryParam.

I am not sure when that option showed up. It is not documented in any of the on-line or printed manuals I have on administering Cold Fusion. The screen shots in the printed manual I have for MX 6 don’t even have that option…so it showed up at 6.1 or later. All I know is that it IS available in 6.1 + Updater.
It all makes sense now….but the lack of documentation is why it escaped me before. I wish I knew why its not documented. I also would like to know why its not checked by default….perhaps a performance or compatibility issue? If anyone out there knows more about this setting….please comment!
2 Comments |
Cold Fusion |
Permalink
Posted by wulimaster
July 28, 2006
I’ve been meaning to figure out how to do this…it was always easy to do on Macintosh systems. Someone else blogged about it for me here
I normally just use DHCP everywhere I connect. But sometimes I need special configs for networks that don’t have a DHCP server running. The problem with those special configs is that they just waste time when you need to go back to the office or your home network. Nothing works and it takes you a few minutes to remember you hosed your network settings to connect to some obscure network somewhere.
In case that link ever dies, the original content follows … Read the rest of this entry »
2 Comments |
Hacks |
Permalink
Posted by wulimaster
July 28, 2006
This post is coming to you as I ride the 81 north bus through Scottsdale. I’m almost at my stop, so this will be quick.
I still don’t have much of a sample…about a month and a half of riding the bus…but it seems like enough to comment on the number of times that the air conditioning does not work. In my short experiment, it has been broken about 25% of the time.
If the valley is serious about fixing the air quality, you think they could get some better buses. I don’t know what budgetary problems they have to deal with. Maybe it just is not in the cards to have decent buses. But it sure makes it tough to ride the bus in the summer.
Leave a Comment » |
ValleyMetro |
Permalink
Posted by wulimaster
July 20, 2006
About a month ago, a coworker told me about FireBug. I did not get around to installing it myself until yesterday. Boy, I should have listened to him a month ago.
In the author’s own words:
FireBug lets you explore the far corners of the DOM by keyboard or mouse. All of the tools you need to poke, prod, and monitor your JavaScript, CSS, HTML and Ajax are brought together into one seamless experience, including a debugger, an error console, command line, and a variety of fun inspectors.
Bottom line, too cool and too useful to describe. You just have to try it yourself. My favorite feature (Because I am completely innept at HTML) is the “Inspector” tab. With that tab open, you can move your mouse around an open web page, and it will highlight the source code to whatever object you are hovering over.
Leave a Comment » |
Tools |
Permalink
Posted by wulimaster