27 בדצמבר 2008
OK, this is the last post on the subject. You can find the first post here and the previous one here. In this post, I want to show you how the tips and tricks we have been discussing make our C++ code quite elegant for the three projects we haven’t reviewed yet: XMLBuilder, XSDValidator and XSLTTransformer. As usual, my benchmark for elegance is a comparison with equivalent C# code, however in the last two projects, the code is not identical in the two languages due to differences in the COM and System.Xml APIs for validation and transformation....
26 בדצמבר 2008
Part 1 is the first post in this series. In Part 4 I described the first of the 5 project pairs provided with this article, DOMAndXPath. In this post I will review the second project – SAXReader. The SAX programming model is very different to the DOM model: SAX models the parser, whereas DOM models the XML document. SAX provides a forward only push model, where as DOM provides random access to nodes in the document. The SAXReader project is based on the MSDN example you can find here. It defines a content handler, attaches it...
25 בדצמבר 2008
Part 1 is the first post in this series. In Part 3 I described 3 simple steps that will help simplify your MSXML enabled C++ project. With those in place we are ready to examine each of the 5 project pairs provided with this article in more detail. Each project demonstrates how to implement a set of basic XML functions using MSXML in C++. In this post I will review the first of the five - DOMAndXPath. This project loads an XML file into a DOM, recursively traverses its nodes and displays them. It then displays a...
24 בדצמבר 2008
See the previous posts for this article here: Part 1, Part 2. Before I review the projects for this article, I would like to describe the basics: a few simple steps that will give you a C# experience while programming MSXML with C++. Step 1: Import MSXML There are a number of ways to import com libraries in a C++ project. I think the simplest way is to add the following line in a common header (best precompiled). #import <msxml6.dll> named_guids This will create the headers (with extensions .tli and...
22 בדצמבר 2008
So, in my opening post on this subject (Part 1), I promised to show you some useful sample code using MSXML, written in C++ yet as elegant as C#. Well. Here is an example of what can be achieved. C++ C# ...
20 בדצמבר 2008
Well, I did say that I would change subjects from time to time : ) This week I taught a class of C++ Programmers how to use MSXML and I sat down to write samples and demos for the lesson. Well, I love C++, but C# has spoiled me. Programming COM directly can get ugly and working with MSXML in C++ is no exception: all those AddRefs and Releases you need to call, HRESULTS you need to handle, and CLSIDs you need to find. Code that accesses COM directly is often error prone,...
17 בדצמבר 2008
Developer Academy 3 was a great success. The convention center was packed ... and all my demos worked :)
You can now view all the lectures online on the DevAcademy3 website.
If you scroll down to DEV305 you can view my presentation, “Leverage SQL Server 2008 in your .Net Code with Visual Studio 2008 SP1”. You can also download the code for the demos.
In the fourth demo you will see how FILESTREAM allowed me to stream high quality HD videos directly from the server.
Following is a description of all the demos.
If you have any questions or problems with...
10 בדצמבר 2008
Recently I have been making progress towards my MCPD certification (one more exam to go :).
Like me, you may have been a little overwhelmed, at first, by the large number of exams and the detailed information on Microsoft’s MCP site. But I assure you, its really quite simple.
I have prepared the attached document to describe the exams, the certifications, and the relations between them. The document is in Hebrew, but the conclusions are posted below in English.
John Bryce Training is offering a dedicated preparation program to speed you on your way toward these prestigious certifications. I recommend you...
9 בדצמבר 2008
This is my second post about some of the performance improvements you will experience when upgrading to SQL Server 2008 and Visual Studio 2008 SP1. In this one we will be taking FILESTREAM for a test ride. During my session at Developer Academy 3 I will be describing how this new feature in SQL Server 2008 can be leveraged from Visual Studio 2008 (SP1) to provide the data integrity and manageability of SQL Server with the access speed of an NTFS file. In preparation, I decided to measure the performance of FILESTREAM using the project attached...
5 בדצמבר 2008
This is my first post of two (maybe more, we’ll see :) about some of the performance improvements you will experience when upgrading to SQL Server 2008 and Visual Studio 2008 SP1.
In this one we will be taking TVP (Table Valued Parameters) for a test ride.
Let’s compare the time it takes to insert a large number of rows into a table using the following methods:
SqlDataAdapter (with different values of the UpdateBatchSize property)
Multiple Inserts (delimited by semicolons)
Packaging the rows to insert as XML and calling a stored procedure that receives it.
A stored procedure with a Table Valued Parameter...