<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://community.devexpress.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Developer Express Inc.</title><link>http://community.devexpress.com/blogs/</link><description>Download - Compare - Decide</description><dc:language>en-US</dc:language><generator>CommunityServer 2007.1 SP1 (Build: 30415.43)</generator><item><title>.NET Reports and exporting to PDF</title><link>http://community.devexpress.com/blogs/ctodx/archive/2008/08/21/net-reports-and-exporting-to-pdf.aspx</link><pubDate>Thu, 21 Aug 2008 18:47:20 GMT</pubDate><guid isPermaLink="false">bd716303-653c-428d-8b8a-a7d998cde032:231961</guid><dc:creator>Julian M Bucknall</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Recently an issue came up with regard to the export to PDF functionality in our printing and reporting suites, XtraPrinting and XtraReports. The issue was in regard to the use of characters that weren&amp;#39;t the normal 7-bit ASCII characters and whether the fonts should be embedded or not in that case.&lt;/p&gt; &lt;p&gt;I decided to take a peek at how we&amp;#39;ve implemented the export to PDF functionality in order that you can gain a better understanding of the issues. Since the whole subject is pretty complicated, I took the hit so that you didn&amp;#39;t have to &lt;img src="http://community.devexpress.com/emoticons/emotion-1.gif" alt="Smile" /&gt;.&lt;/p&gt; &lt;p&gt;With PDF, there is a fundamental distinction between the notion of a character and a glyph. A &lt;em&gt;character&lt;/em&gt; is a symbol, like &amp;quot;A&amp;quot; or &amp;quot;4&amp;quot;, whereas a &lt;em&gt;glyph&lt;/em&gt; is an image or rendering of that character. A collection of glyphs is known as a &lt;em&gt;font&lt;/em&gt;.&lt;/p&gt; &lt;p&gt;Easy enough, except that a character has to be encoded in some way into a binary number. We&amp;#39;re used to thinking of the character &amp;quot;A&amp;quot;, for example, as being encoded as 0x41. This particular encoding started life in ASCII and has now propagated into Unicode. &lt;/p&gt; &lt;p&gt;That&amp;#39;s all very well, but in the days when a character was encoded in a byte value, there weren&amp;#39;t enough bit values available to encode all possible characters. So the notion of codepages evolved to encode different characters in the range 128 to 255. In the Latin codepage or character set (sometimes known as Latin-1 or Windows 1252), for example, the character à is encoded as 0xE0 (and, again, that propagated to Unicode). However, on the Mac the character à is encoded as 0x88.&lt;/p&gt; &lt;p&gt;Back to PDF. PDF is a file format that is essentially text and not binary. (Yes, I&amp;#39;m oversimplifying since text blocks can be compressed using the Deflate algorithm and will appear as binary blobs, but bear with me.) The text is obviously represented using some encoding. There are a set of standard encodings for text in PDFs: one for Macs called MacRomanEncoding, one for &amp;quot;Windows ANSI&amp;quot; (which is essentially codepage 1252) called WinAnsiEncoding, and one for a more general PDF codepage called PDFDocEncoding. All of these encodings are single byte encodings: each byte value represents a different character.&lt;/p&gt; &lt;p&gt;Back to fonts in PDFs (as you can see, there are lots of strands to pull together here to get the full tapestry). There are two different ways to define the fonts in a PDF. The first, and very lightweight way, is to describe the font as a set of metrics (name, width of glyphs, slope of italics, and so on). The reader of the PDF (say, Acrobat Reader) is then responsible for locating the font on the user&amp;#39;s machine and using it. If the actual font is not available on the user&amp;#39;s machine, the reader then has to locate the nearest font that matches the font metrics embedded in the PDF.&lt;/p&gt; &lt;p&gt;If the PDF uses fonts in this way, the text in the PDF is encoded as one of the standard encodings. As you can imagine, you are relying on the user machine being pretty similar to the machine that generates the PDF, otherwise the user is possibly going to get some weird effects (wrong or missing glyphs, a different look to the page, and so on). &lt;/p&gt; &lt;p&gt;In XtraPrinting and XtraReports, we used to use PDFDocEncoding in this situation. However, the majority of our customers use the Latin-1 codepage, and so there was a possibility that reports could have some missing or invalid glyphs when exported as a PDF for these customers. For the next minor version (2008.2.3), we&amp;#39;ve switched to WinAnsiEncoding and this change should help more people.&lt;/p&gt; &lt;p&gt;Of course, you may be thinking that it&amp;#39;s nice to generate very small PDFs in this way, but it&amp;#39;s all a little bit too hit and miss on the reader side. That&amp;#39;s why there is a second way of defining fonts in PDFs: to embed them. &lt;/p&gt; &lt;p&gt;Here the onus is on the writer of the PDF. It has to analyze the text in the PDF, work out which glyphs of the font are being used and then embed those glyphs directly in the PDF. If fonts are embedded in the PDF in this way, the text is actually encoded in a two-byte manner and a map is generated that maps the character encoding to the index of the glyph in the embedded font.&lt;/p&gt; &lt;p&gt;Using fonts in this way, you get absolute precision control. What You See (as the writer) Is What You Get (as the reader). There is no wishy-washy, crossed-fingers, hope-for-the-best aspect to reading the PDF: the end-user will see exactly what you wanted them to see, no dropped or swapped glyphs. The downside to this is, obviously, the PDF is &amp;quot;heavier&amp;quot; or larger since it has to have all those glyphs embedded.&lt;/p&gt; &lt;p&gt;(Note to those who are really clued up on PDFs and character encodings and font support. There is yet another method: the writer can define a &lt;em&gt;ToUnicode&lt;/em&gt; character map, or CMap, that is a single-byte encoding that uses a special map to work out which glyph to use with a font that&amp;#39;s not embedded. We don&amp;#39;t support this variant yet.)&lt;/p&gt; &lt;p&gt;Having said all that, you can mix and match. You can have some text in your PDF where you assume that the reader will have the required fonts available to display it, and you can have some text where you embed the fonts. In our printing suites, you can manage this scenario by using the NeverEmbeddedFonts property. If you name a font in the NeverEmbeddedFonts property (it&amp;#39;s a semicolon-separated list of font names) it will be defined in the PDF in the first, lightweight, way. If a font is used in the PDF that is not in this list, then it will be embedded in the PDF in the second, heavier, way.&lt;/p&gt; &lt;p&gt;And that&amp;#39;s pretty much it. I hope that this exposition has made the whole issue of fonts in PDFs clearer and that it helps you make the best decisions in your particular scenario when you need to export your report to PDF for your users.&lt;/p&gt;&lt;img src="http://community.devexpress.com/aggbug.aspx?PostID=231961" width="1" height="1"&gt;</description></item><item><title>devLink Conference 2008 in Tennessee</title><link>http://community.devexpress.com/blogs/aspnet/archive/2008/08/20/devlink-conference-2008-in-nashville-tennessee.aspx</link><pubDate>Thu, 21 Aug 2008 06:33:05 GMT</pubDate><guid isPermaLink="false">bd716303-653c-428d-8b8a-a7d998cde032:231892</guid><dc:creator>Mehul Harry (Developer Express)</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&lt;a href="http://devlink.net/" target="_blank"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" title="image" border="0" alt="image" src="http://community.devexpress.com/blogs/aspnet/WindowsLiveWriter/DevLinkConference_143F4/image_6.png" width="630" height="104" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The devLink 2008 conference in Nashville, Tennessee is already here! If you were lucky enough to get registered before it sold out then drop by the &lt;a href="http://www.devexpress.com/" target="_blank"&gt;Developer Express&lt;/a&gt; booth and say Hello. I’ll be there to answer your questions and show you some cool demos. &lt;/p&gt;  &lt;p&gt;There are a bunch of great new tools that we’ve been working on this year and you can come talk with me about things like:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Our ASP.NET tools &lt;/li&gt;    &lt;li&gt;WPF DataGrid &lt;/li&gt;    &lt;li&gt;Silverlight controls &lt;/li&gt;    &lt;li&gt;Our rich WinForms controls &lt;/li&gt;    &lt;li&gt;My new iPhone 3G &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;While it’s not PDC, there’s probably some good tracks and speakers there because the event is already sold out. In fact, there’s a &lt;a href="http://devlink.net/TravelInfo/RidethedevLinkBus/tabid/116/Default.aspx" target="_blank"&gt;devLink bus&lt;/a&gt; on a road trip to the conference. You can follow many of the developers on the bus through their &lt;a href="http://search.twitter.com/search?q=devlink" target="_blank"&gt;twitter stream&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Oh and if you stop by the booth and mention this post then you’ll get my thanks and probably a nice DevExpress T-Shirt too.&lt;/p&gt;  &lt;p&gt;So drop by the booth before they’re all gone. :-)&lt;/p&gt;&lt;img src="http://community.devexpress.com/aggbug.aspx?PostID=231892" width="1" height="1"&gt;</description><category domain="http://community.devexpress.com/blogs/aspnet/archive/tags/Conference/default.aspx">Conference</category></item><item><title>XPOlympics – Serialising RSS Feeds Using XPO</title><link>http://community.devexpress.com/blogs/garyshort/archive/2008/08/20/xpolympics-serialising-rss-feeds-using-xpo.aspx</link><pubDate>Wed, 20 Aug 2008 12:19:31 GMT</pubDate><guid isPermaLink="false">bd716303-653c-428d-8b8a-a7d998cde032:231767</guid><dc:creator>Gary Short (Developer Express)</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Although the UK is a crowded island sitting on the border of the Atlantic Ocean and the North Sea, comfortably far from mainland Europe, its population is relatively small; in fact when compared to the those of China or India it is, in fact, tiny (estimated to be 60.7 million as of July 2007). Perhaps it is this fact that means I am always surprised when the UK does well at global scale sporting events such as the Olympics, and there is no doubt that Team GB (more correctly Great Britain and Northern Ireland) has excelled at these games, putting in the best performance, in terms of medal haul, since the 1908 games.&lt;/p&gt;  &lt;p&gt;So what has all this to do with XPO? Well I like to keep up with what is going on at the Olympics but that “work thing” just keeps getting in the way. Coupled with that I’d really like to record all the news so that I can go back and analyse&amp;#160; it after the event. So, what I really need is a little application to handle the following requirements:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Read an XML file and fetch one or more RSS feed URLs&lt;/li&gt;    &lt;li&gt;For each feed&lt;/li&gt;    &lt;ol&gt;     &lt;li&gt;Check if that feed has been serialised previously&lt;/li&gt;      &lt;ol&gt;       &lt;li&gt;If it hasn’t&lt;/li&gt;        &lt;ol&gt;         &lt;li&gt;Create it&lt;/li&gt;       &lt;/ol&gt;        &lt;li&gt;If it has then fetch the matching feed object from the database&lt;/li&gt;     &lt;/ol&gt;      &lt;li&gt;Send a HEAD request to the web server for the RSS feed file header information&lt;/li&gt;      &lt;ol&gt;       &lt;li&gt;Examine the last-modified header&lt;/li&gt;        &lt;ol&gt;         &lt;li&gt;If there is no last-modified header then skip this file&lt;/li&gt;          &lt;li&gt;If the file has not been updated since last read then skip the file&lt;/li&gt;       &lt;/ol&gt;     &lt;/ol&gt;      &lt;li&gt;Fetch all the news items from the RSS feed&lt;/li&gt;      &lt;ol&gt;       &lt;li&gt;For each news item&lt;/li&gt;        &lt;ol&gt;         &lt;li&gt;Create a news item object&lt;/li&gt;          &lt;li&gt;Check if the fetched / created feed object has this news item already&lt;/li&gt;          &lt;ol&gt;           &lt;li&gt;If it does then skip this news item&lt;/li&gt;            &lt;li&gt;Otherwise add the news item to the feed&lt;/li&gt;         &lt;/ol&gt;       &lt;/ol&gt;     &lt;/ol&gt;      &lt;li&gt;Set the lastUpdate date to now.&lt;/li&gt;   &lt;/ol&gt;    &lt;li&gt;Serialise the newly created object graph to the database&lt;/li&gt;    &lt;li&gt;This process must be able to be automated using the Windows AT command&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Looking at the requirements, it’s clear to see that, apart from doing a few sensible checks, all that is required is that an RSS feed is serialised to a database, that sounds to me like a perfect job for XPO. Now, a blog posting is not a suitable place to examine such an application line by line (I leave that as an exercise for the reader) but let’s look at some of the more pertinent points of the application.&lt;/p&gt;  &lt;p&gt;Firstly I could have used an &lt;a href="http://en.wikipedia.org/wiki/OPML"&gt;OPML file&lt;/a&gt; to contain my list of RSS feed URLs that is, after all, what it was designed for. However, I felt that was a little overkill for the purposes of our application and so I went with a more simplified “roll you own” file structure as shown below.&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color:#a31515;"&gt;xml &lt;/span&gt;&lt;span style="color:red;"&gt;version&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;1.0&lt;/span&gt;&amp;quot; &lt;span style="color:red;"&gt;encoding&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;utf-8&lt;/span&gt;&amp;quot; &lt;span style="color:blue;"&gt;?&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Feeds&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Feed&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Name&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;Feed Name&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Name&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Url&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;Feed URL&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Url&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Feed&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;  &lt;/span&gt;&lt;span style="color:blue;"&gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Feeds&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Having specified which feeds we wish to read (my application reads the 32 BBC feeds dedicated to the Olympics) we should now go ahead and specify our Feed and NewsItem domain objects. I’m not going to cover that here as it is &lt;a href="http://www.devexpress.com/Help/?document=XPO/CustomDocument2256.htm&amp;amp;levelup=true"&gt;clearly documented&lt;/a&gt; on our web site.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;The first thing I’d like to draw your attention to is the fact that, by default, XPO will serialise objects to an Access database, if you want to use another database (and we support over 15 RDBMSs) then you have to inform XPO like so:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;private void &lt;/span&gt;SetUpXPODataLayer() {
    &lt;span style="color:blue;"&gt;string &lt;/span&gt;conn =
        &lt;span style="color:#2b91af;"&gt;MSSqlConnectionProvider&lt;/span&gt;.GetConnectionString(&lt;span style="color:#a31515;"&gt;&amp;quot;.&amp;quot;&lt;/span&gt;,
            &lt;span style="color:#a31515;"&gt;&amp;quot;XPOlympics&amp;quot;&lt;/span&gt;);

    &lt;span style="color:#2b91af;"&gt;XpoDefault&lt;/span&gt;.DataLayer =
        &lt;span style="color:#2b91af;"&gt;XpoDefault&lt;/span&gt;.GetDataLayer(conn,
            &lt;span style="color:#2b91af;"&gt;AutoCreateOption&lt;/span&gt;.DatabaseAndSchema);
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;The next thing I want to draw your attention to is not specifically XPO related but is, never the less, interesting. It is the technique of only fetching the header information from the web server to ascertain whether or not a file has been updated, this prevents you having to download the entire file unnecessarily and is done like this:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color:green;"&gt;//GS - Make a request for the feed header info only and 
//get the last-modified date
&lt;/span&gt;&lt;span style="color:#2b91af;"&gt;HttpWebRequest &lt;/span&gt;webRequest =
    &lt;span style="color:#2b91af;"&gt;HttpWebRequest&lt;/span&gt;.Create(feed.Url) &lt;span style="color:blue;"&gt;as &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;HttpWebRequest&lt;/span&gt;;
webRequest.Method = &lt;span style="color:#a31515;"&gt;&amp;quot;HEAD&amp;quot;&lt;/span&gt;;
webRequest.KeepAlive = &lt;span style="color:blue;"&gt;false&lt;/span&gt;;

&lt;span style="color:#2b91af;"&gt;WebResponse &lt;/span&gt;webResponse = &lt;span style="color:blue;"&gt;null&lt;/span&gt;;
&lt;span style="color:blue;"&gt;string &lt;/span&gt;lastModifiedDateString = &lt;span style="color:#2b91af;"&gt;String&lt;/span&gt;.Empty;
&lt;span style="color:blue;"&gt;try &lt;/span&gt;{
    webResponse = webRequest.GetResponse();
    lastModifiedDateString =
    webResponse.Headers.Get(&lt;span style="color:#a31515;"&gt;&amp;quot;Last-Modified&amp;quot;&lt;/span&gt;);
}
&lt;span style="color:blue;"&gt;catch &lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;WebException &lt;/span&gt;wex) {
    &lt;span style="color:#2b91af;"&gt;Trace&lt;/span&gt;.WriteLine(&lt;span style="color:#2b91af;"&gt;String&lt;/span&gt;.Format(&lt;span style="color:#a31515;"&gt;&amp;quot;{0} - {1} {2}&amp;quot;&lt;/span&gt;,
        &lt;span style="color:#2b91af;"&gt;DateTime&lt;/span&gt;.Now, wex.Message, feed.Name));
    &lt;span style="color:#2b91af;"&gt;Trace&lt;/span&gt;.Flush();
    &lt;span style="color:#2b91af;"&gt;Trace&lt;/span&gt;.Close();
    &lt;span style="color:blue;"&gt;continue&lt;/span&gt;;
}
&lt;span style="color:blue;"&gt;finally &lt;/span&gt;{
    &lt;span style="color:blue;"&gt;if &lt;/span&gt;(webResponse != &lt;span style="color:blue;"&gt;null&lt;/span&gt;) {
        webResponse.Close();
    }
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;Note the use of the “KeepAlive = false;” line above, this prevents the HttpWebRequest object from keeping the connection open and causing “connection leaks”. &lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Whilst I’m on the subject of things which are not specifically XPO related but are interesting anyway, note the use of LINQ to XML to extract the news items from the feed, isn’t that syntax so much nicer that the XPath way of doing things?&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;var &lt;/span&gt;newsItems =
    &lt;span style="color:blue;"&gt;from &lt;/span&gt;item &lt;span style="color:blue;"&gt;in &lt;/span&gt;feedDoc.Descendants(&lt;span style="color:#a31515;"&gt;&amp;quot;item&amp;quot;&lt;/span&gt;)
    &lt;span style="color:blue;"&gt;select new &lt;/span&gt;{
        Title = item.Element(&lt;span style="color:#a31515;"&gt;&amp;quot;title&amp;quot;&lt;/span&gt;).Value,
        Description = item.Element(&lt;span style="color:#a31515;"&gt;&amp;quot;description&amp;quot;&lt;/span&gt;).Value,
        PubDate = item.Element(&lt;span style="color:#a31515;"&gt;&amp;quot;pubDate&amp;quot;&lt;/span&gt;).Value,
        Category = item.Element(&lt;span style="color:#a31515;"&gt;&amp;quot;category&amp;quot;&lt;/span&gt;).Value,
        Url = item.Element(&lt;span style="color:#a31515;"&gt;&amp;quot;link&amp;quot;&lt;/span&gt;).Value
    };&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Anyway, this is an XPO blog so let’s get back on topic shall we? Having fetched or created a new feed and extracted the news items from the RSS document we want to add the news item to the feed, but only if it hasn’t been added before, we don’t want duplicate news items in our feed. We can use XPO to check it’s not been added already this way:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;if &lt;/span&gt;(!aFeed.NewsItems.Contains&amp;lt;&lt;span style="color:#2b91af;"&gt;NewsItem&lt;/span&gt;&amp;gt;(aNewsItem)) {
    aFeed.NewsItems.Add(aNewsItem);
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Now, all that remains for us to do is to serialise our newly created object graph to the database by calling &lt;a href="http://www.devexpress.com/Help/?document=xpo/devexpressxpounitofwork_commitchangestopic.htm"&gt;CommitChanges()&lt;/a&gt; on the &lt;a href="http://www.devexpress.com/Help/?document=xpo/customdocument2138.htm"&gt;UnitOfWork&lt;/a&gt; object.&lt;/p&gt;

&lt;p&gt;If you would like to download the full application and have a look at it, you can get it &lt;a href="http://community.devexpress.com/blogs/garyshort/XPOlympics.zip"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:2ba74c1a-13a7-4cb0-85e7-5c39a3b88310" style="padding-right:0px;display:inline;padding-left:0px;float:none;padding-bottom:0px;margin:0px;padding-top:0px;"&gt;Technorati tags: &lt;a href="http://technorati.com/tags/XPO" rel="tag"&gt;XPO&lt;/a&gt;, &lt;a href="http://technorati.com/tags/RSS" rel="tag"&gt;RSS&lt;/a&gt;, &lt;a href="http://technorati.com/tags/Olympics" rel="tag"&gt;Olympics&lt;/a&gt;&lt;/div&gt;&lt;div class="wlWriterHeaderFooter" style="text-align:left;margin:0px;padding:4px 0px 4px 0px;"&gt;&lt;a href="http://digg.com/submit?url=http%3a%2f%2fcommunity.devexpress.com%2fblogs%2fgaryshort%2farchive%2f2008%2f08%2f20%2fxpolympics-serialising-rss-feeds-using-xpo.aspx&amp;amp;title=XPOlympics+%e2%80%93+Serialising+RSS+Feeds+Using+XPO"&gt;&lt;img src="http://digg.com/img/badges/100x20-digg-button.png" width="100" height="20" alt="Digg This" title="Digg This" border="0" style="border:0;" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;img src="http://community.devexpress.com/aggbug.aspx?PostID=231767" width="1" height="1"&gt;</description><category domain="http://community.devexpress.com/blogs/garyshort/archive/tags/XPO/default.aspx">XPO</category></item><item><title>Using SQL Server 2008 spatial data from XPO</title><link>http://community.devexpress.com/blogs/xpo/archive/2008/08/19/using-sql-server-2008-spatial-data-from-xpo.aspx</link><pubDate>Tue, 19 Aug 2008 14:00:00 GMT</pubDate><guid isPermaLink="false">bd716303-653c-428d-8b8a-a7d998cde032:231621</guid><dc:creator>Oliver Sturm (Developer Express)</dc:creator><slash:comments>5</slash:comments><description>&lt;p&gt;Boris posted me some code that I used to play around with, in order to make XPO work with &lt;a href="http://msdn.microsoft.com/en-us/library/bb933876.aspx"&gt;SQL Server 2008 spatial data&lt;/a&gt;. It is possible to make it work, quite easily actually, but there are a few things that need to be considered, and where more than one solution is possible. Let&amp;#39;s see.&lt;/p&gt;
&lt;p&gt;First, we need a class to store data in the client application. This is the one I&amp;#39;m using:&lt;/p&gt;
&lt;div style="font-family:Consolas;font-size:11pt;color:black;background:white;"&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;PolygonData&lt;/span&gt;: &lt;span style="color:#2b91af;"&gt;XPObject&lt;/span&gt; {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; PolygonData(&lt;span style="color:#2b91af;"&gt;Session&lt;/span&gt; session)&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; : &lt;span style="color:blue;"&gt;base&lt;/span&gt;(session) { }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;private&lt;/span&gt; &lt;span style="color:blue;"&gt;string&lt;/span&gt; name;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;string&lt;/span&gt; Name {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;get&lt;/span&gt; { &lt;span style="color:blue;"&gt;return&lt;/span&gt; name; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;set&lt;/span&gt; { SetPropertyValue(&lt;span style="color:#a31515;"&gt;&amp;quot;Name&amp;quot;&lt;/span&gt;, &lt;span style="color:blue;"&gt;ref&lt;/span&gt; name, &lt;span style="color:blue;"&gt;value&lt;/span&gt;); }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color:#2b91af;"&gt;SqlGeography&lt;/span&gt; polygon;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; [&lt;span style="color:#2b91af;"&gt;ValueConverter&lt;/span&gt;(&lt;span style="color:blue;"&gt;typeof&lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;GeographyConverter&lt;/span&gt;))]&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; [&lt;span style="color:#2b91af;"&gt;DbType&lt;/span&gt;(&lt;span style="color:#a31515;"&gt;&amp;quot;geography&amp;quot;&lt;/span&gt;)]&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;SqlGeography&lt;/span&gt; Polygon {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;get&lt;/span&gt; { &lt;span style="color:blue;"&gt;return&lt;/span&gt; polygon; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;set&lt;/span&gt; { SetPropertyValue(&lt;span style="color:#a31515;"&gt;&amp;quot;Polygon&amp;quot;&lt;/span&gt;, &lt;span style="color:blue;"&gt;ref&lt;/span&gt; polygon, &lt;span style="color:blue;"&gt;value&lt;/span&gt;); }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; }&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;This is already the first thing that probably needs some thought. In order to use the SqlGeography class as the property type, it is necessary to have a reference to the assembly Microsoft.SqlServer.Types. That assembly is not currently part of the .NET Framework, but it is installed together with SQL Server. As the SqlGeography class has several pieces of useful functionality (and there are other useful classes in the same assembly), it seems weird that they aren&amp;#39;t available in the &amp;quot;standard client&amp;quot;. Apparently Microsoft prepared these classes for server-side use, and obviously this makes some sense if you&amp;#39;re going to use .NET on the server in some way, but still... there are a number of blog posts out there on the topic (try searching &lt;a href="http://www.google.com/search?q=sqlgeography+client+side"&gt;SqlGeography client side&lt;/a&gt;, for instance), and &lt;a href="http://viswaug.wordpress.com/2008/05/23/using-the-sqlgeography-type-when-working-with-sql-server-2008-spatial-features/"&gt;at least one of them&lt;/a&gt; points to a future solution that involves a separate redistributable which might become available at some point. For the time being, it would probably be possible to install the assembly in question on the client manually -- but please note that I haven&amp;#39;t looked into legal issues involved with this, so be careful!&lt;/p&gt;
&lt;p&gt;If, for whatever reasons, you don&amp;#39;t want to go this way, you would have to create your own client-side class to represent the spatial information. The other approaches described in this post would still be quite similar though.&lt;/p&gt;
&lt;p&gt;Now, as you can see, the property for the Polygon in my code is decorated with two attributes. The DbType attribute makes sure that the field gets created with the correct type &amp;quot;geography&amp;quot; in SQL Server. The ValueConverter attribute is used to convert the geography into the string format needed in SQL. Here it is:&lt;/p&gt;
&lt;div style="font-family:Consolas;font-size:11pt;color:black;background:white;"&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;GeographyConverter&lt;/span&gt; : &lt;span style="color:#2b91af;"&gt;ValueConverter&lt;/span&gt; {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;override&lt;/span&gt; &lt;span style="color:blue;"&gt;object&lt;/span&gt; ConvertFromStorageType(&lt;span style="color:blue;"&gt;object&lt;/span&gt; value) {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;if&lt;/span&gt; (value &lt;span style="color:blue;"&gt;is&lt;/span&gt; &lt;span style="color:blue;"&gt;string&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;return&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;SqlGeography&lt;/span&gt;.Parse((&lt;span style="color:blue;"&gt;string&lt;/span&gt;) value);&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;else&lt;/span&gt; &lt;span style="color:blue;"&gt;return&lt;/span&gt; value;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;override&lt;/span&gt; &lt;span style="color:blue;"&gt;object&lt;/span&gt; ConvertToStorageType(&lt;span style="color:blue;"&gt;object&lt;/span&gt; value) {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;return&lt;/span&gt; value == &lt;span style="color:blue;"&gt;null&lt;/span&gt; ? &lt;span style="color:blue;"&gt;null&lt;/span&gt; : ((&lt;span style="color:#2b91af;"&gt;SqlGeography&lt;/span&gt;) value).ToString( );&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;override&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Type&lt;/span&gt; StorageType {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;get&lt;/span&gt; { &lt;span style="color:blue;"&gt;return&lt;/span&gt; &lt;span style="color:blue;"&gt;typeof&lt;/span&gt;(&lt;span style="color:blue;"&gt;string&lt;/span&gt;); }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; }&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;The ConvertFromStorageType function implementation is a bit weird, since it simply skips the conversion if the object that&amp;#39;s getting passed in is not a string. This is perhaps not the most secure way of implementing this, but it&amp;#39;s good enough for the purpose of the demo. The reason I&amp;#39;m expecting objects that might not be strings is explained further down and it has to do with performance -- depending on the decision you make at that point, you might implement this function in slightly different ways.&lt;/p&gt;
&lt;p&gt;To create a bit test data, I&amp;#39;m using the following helper function in my code (the SqlGeographyBuilder is another class from Microsoft.SqlServer.Types):&lt;/p&gt;
&lt;div style="font-family:Consolas;font-size:11pt;color:black;background:white;"&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;private&lt;/span&gt; &lt;span style="color:blue;"&gt;static&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;SqlGeography&lt;/span&gt; CreatePolygon( ) {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#2b91af;"&gt;SqlGeographyBuilder&lt;/span&gt; builder = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;SqlGeographyBuilder&lt;/span&gt;( );&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; builder.SetSrid(4326); &lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; builder.BeginGeography(&lt;span style="color:#2b91af;"&gt;OpenGisGeographyType&lt;/span&gt;.Polygon);&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; builder.BeginFigure(55.36728, -2.74941);&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; builder.AddLine(55.40002, -2.68289);&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; builder.AddLine(55.39908, -2.74913);&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; builder.AddLine(55.36728, -2.74941);&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; builder.EndFigure( );&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; builder.EndGeography( );&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;return&lt;/span&gt; builder.ConstructedGeography;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;With this in place, I can create and store some data:&lt;/p&gt;
&lt;div style="font-family:Consolas;font-size:11pt;color:black;background:white;"&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;using&lt;/span&gt; (&lt;span style="color:#2b91af;"&gt;UnitOfWork&lt;/span&gt; uow = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;UnitOfWork&lt;/span&gt;( )) {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;PolygonData&lt;/span&gt;(uow) {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Name = &lt;span style="color:#a31515;"&gt;&amp;quot;Test 1&amp;quot;&lt;/span&gt;,&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Polygon = CreatePolygon( )&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }.Save( );&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; uow.CommitChanges( );&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;If you are following along and you&amp;#39;ve built your own sample with these code snippets, you will be able to execute the sample at this point. It will get a table created in SQL Server and the spatial data inserted. Wonderful!&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://community.devexpress.com/blogs/xpo/spatialresults.png" width="400" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;Finally, of course we want to read data back from the database. In my sample, I&amp;#39;m using this simple piece of code to do it:&lt;/p&gt;
&lt;div style="font-family:Consolas;font-size:11pt;color:black;background:white;"&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;using&lt;/span&gt; (&lt;span style="color:#2b91af;"&gt;UnitOfWork&lt;/span&gt; uow = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;UnitOfWork&lt;/span&gt;( )) {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;var&lt;/span&gt; polygons = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;XPCollection&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af;"&gt;PolygonData&lt;/span&gt;&amp;gt;( );&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;foreach&lt;/span&gt; (&lt;span style="color:blue;"&gt;var&lt;/span&gt; polygon &lt;span style="color:blue;"&gt;in&lt;/span&gt; polygons) {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#2b91af;"&gt;Console&lt;/span&gt;.WriteLine(polygon.Name);&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#2b91af;"&gt;Console&lt;/span&gt;.WriteLine(polygon.Polygon);&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;If you try to run this, you will see an exception though. The reason for that is that there are types here which don&amp;#39;t match up. The SQL Server client library, somewhat confusingly, returns an object that is actually of type SqlGeography, whereas our type converter defines a storage type of string ins StorageType property. As a result, a function called ReformatReadValue is called on the connection provider we&amp;#39;re using (MSSqlConnectionProvider by default), and that function attempts to use the .NET Framework standard Convert.ChangeType function to convert a SqlGeography into a string. That function in turn expects the object to implement IConvertable, and throws an exception because it doesn&amp;#39;t do that. Phew.&lt;/p&gt;
&lt;p&gt;So what&amp;#39;s the solution to this problem? Well, making the ReformatReadValue function do the conversion of SqlGeography into string, that&amp;#39;s one solution. Let&amp;#39;s derive a connection provider and override that function:&lt;/p&gt;
&lt;div style="font-family:Consolas;font-size:11pt;color:black;background:white;"&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;GISProvider&lt;/span&gt; : &lt;span style="color:#2b91af;"&gt;MSSqlConnectionProvider&lt;/span&gt; {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; GISProvider(&lt;span style="color:#2b91af;"&gt;IDbConnection&lt;/span&gt; connection, &lt;span style="color:#2b91af;"&gt;AutoCreateOption&lt;/span&gt; autoCreateOption)&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; : &lt;span style="color:blue;"&gt;base&lt;/span&gt;(connection, autoCreateOption) {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;protected&lt;/span&gt; &lt;span style="color:blue;"&gt;override&lt;/span&gt; &lt;span style="color:blue;"&gt;object&lt;/span&gt; ReformatReadValue(&lt;span style="color:blue;"&gt;object&lt;/span&gt; value, &lt;span style="color:#2b91af;"&gt;ReformatReadValueArgs&lt;/span&gt; args) {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;if&lt;/span&gt; (value != &lt;span style="color:blue;"&gt;null&lt;/span&gt;) {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#2b91af;"&gt;Type&lt;/span&gt; valueType = value.GetType( );&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;if&lt;/span&gt; (valueType == &lt;span style="color:blue;"&gt;typeof&lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;SqlGeography&lt;/span&gt;) || valueType == &lt;span style="color:blue;"&gt;typeof&lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;SqlGeometry&lt;/span&gt;))&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;return&lt;/span&gt; value.ToString( );&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;return&lt;/span&gt; &lt;span style="color:blue;"&gt;base&lt;/span&gt;.ReformatReadValue(value, args);&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; }&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Now we need to make sure this is the provider we&amp;#39;re using, instead of the standard MSSqlConnectionProvider. We can do this with an initialization line like this:&lt;/p&gt;
&lt;div style="font-family:Consolas;font-size:11pt;color:black;background:white;"&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#2b91af;"&gt;XpoDefault&lt;/span&gt;.DataLayer =&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;SimpleDataLayer&lt;/span&gt;(&lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;GISProvider&lt;/span&gt;(&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;SqlConnection&lt;/span&gt;(&lt;span style="color:#a31515;"&gt;&amp;quot;data source=.;integrated security=SSPI;initial catalog=XPOSql2008Spatial&amp;quot;&lt;/span&gt;), &lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#2b91af;"&gt;AutoCreateOption&lt;/span&gt;.DatabaseAndSchema));&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;If you&amp;#39;re following along, try running your application again, with the reading code in place, and you should see the geography information read back to the client and shown on the console.&lt;/p&gt;
&lt;p&gt;There&amp;#39;s one problem with this code, and I&amp;#39;m sure you have noticed already: we are getting back a SqlGeography instance from the database client code, and this gets passed in to the ReformatReadValue method in the XPO infrastructure. There it is converted into a string. Then it gets passed into the configured value converter for the Polygon property, and gets converted in a SqlGeography instance. Sounds suboptimal, doesn&amp;#39;t it? Yeah...&lt;/p&gt;
&lt;p&gt;There is a solution to this, but it&amp;#39;s not entirely perfect. It is possible to simply ignore what ReformatReadValue wants us to do and just not convert the object (leave off the ToString() from the value the method returns). Then the SqlGeography type object will be passed in to the value converter, which needs to be implemented to ignore the fact that this is not really a string it receives. Remember, I already pointed this out above - if you want to go this &amp;quot;better performance&amp;quot; way, your value converter will have to be able to deal with the fact that it might receive objects to convert that have actually already been converted.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m only describing this solution instead of showing the code, because it&amp;#39;s not really something I want to recommend. This solution neglects the contracts of the XPO infrastructure, and that is of course a bad thing when changes are made in the future. It might also be a problem if the data has to be serialized after being read from the database - having it in string format is what XPO normally assumes, and that works well with all types of serialization. I haven&amp;#39;t made any real tests, so I can just say I don&amp;#39;t know precisely what will happen if SqlGeography instances are sent across the wire using Remoting, XML Web Services, WCF or other frameworks. So - if you&amp;#39;re interested in the performance gain, Remoting and so on are perhaps not a concern of yours (it seems unlikely anyway that Remoting and the perf gain from a few saved string conversions are *both* important to you), then it shouldn&amp;#39;t be hard to use this approach I described. Please note though that you should take extra care to have relevant unit tests in place, so that changes in future XPO versions don&amp;#39;t catch you out.&lt;/p&gt;
&lt;p&gt;Overall it seems a bit weird the way this feature has been implemented. The client side seems to convert the spatial data into the original type automatically, pretty much whether you want it or not - at least that&amp;#39;s how I understand it at this point. Since I push in string data through SQL in order to store the information, it would seem logical to be able to retrieve the string data only, and make my own decision about converting it back into object data, and specifically about the right point in time to do this. Perhaps it fits in somehow with Microsoft&amp;#39;s decision not to make Microsoft.SqlServer.Types available in the client by default. Or perhaps there&amp;#39;s something I missing right now in this regard :-)&lt;/p&gt;
&lt;p&gt;Anyway, have fun! Here&amp;#39;s the complete code of the sample I created: &lt;a href="http://community.devexpress.com/blogs/xpo/XPOSql2008Spatial.zip"&gt;XPOSql2008Spatial.zip&lt;/a&gt; (4201 bytes)&lt;/p&gt;&lt;img src="http://community.devexpress.com/aggbug.aspx?PostID=231621" width="1" height="1"&gt;</description></item><item><title>XPO and FILESTREAM - update</title><link>http://community.devexpress.com/blogs/xpo/archive/2008/08/15/xpo-and-filestream-update.aspx</link><pubDate>Fri, 15 Aug 2008 10:40:00 GMT</pubDate><guid isPermaLink="false">bd716303-653c-428d-8b8a-a7d998cde032:231270</guid><dc:creator>Oliver Sturm (Developer Express)</dc:creator><slash:comments>3</slash:comments><description>&lt;p&gt;Yesterday I wrote about &lt;a href="http://community.devexpress.com/blogs/xpo/archive/2008/08/14/xpo-and-sql-server-2008-filestream-support.aspx"&gt;using the new SQL Server 2008 FILESTREAM feature with XPO&lt;/a&gt;, and this morning Boris from our XPO team sent me an IM going &amp;quot;na na na, I found an easier way to do this&amp;quot;. Okay, maybe he didn&amp;#39;t quite put it like that :-) Anyway, here&amp;#39;s the code he sent me:&lt;/p&gt;
&lt;div style="font-family:Consolas;font-size:11pt;color:black;background:white;"&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Something&lt;/span&gt; : &lt;span style="color:#2b91af;"&gt;XPObject&lt;/span&gt; {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; Something(&lt;span style="color:#2b91af;"&gt;Session&lt;/span&gt; session)&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; : &lt;span style="color:blue;"&gt;base&lt;/span&gt;(session) { }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;override&lt;/span&gt; &lt;span style="color:blue;"&gt;void&lt;/span&gt; AfterConstruction( ) {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;base&lt;/span&gt;.AfterConstruction( );&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; streamId = &lt;span style="color:#2b91af;"&gt;Guid&lt;/span&gt;.NewGuid( );&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;private&lt;/span&gt; &lt;span style="color:blue;"&gt;string&lt;/span&gt; strVal;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;string&lt;/span&gt; StrVal {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;get&lt;/span&gt; { &lt;span style="color:blue;"&gt;return&lt;/span&gt; strVal; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;set&lt;/span&gt; { SetPropertyValue(&lt;span style="color:#a31515;"&gt;&amp;quot;StrVal&amp;quot;&lt;/span&gt;, &lt;span style="color:blue;"&gt;ref&lt;/span&gt; strVal, &lt;span style="color:blue;"&gt;value&lt;/span&gt;); }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;private&lt;/span&gt; &lt;span style="color:blue;"&gt;byte&lt;/span&gt;[] streamData;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; [&lt;span style="color:#2b91af;"&gt;DbType&lt;/span&gt;(&lt;span style="color:#a31515;"&gt;&amp;quot;VARBINARY(MAX) FILESTREAM&amp;quot;&lt;/span&gt;)]&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;byte&lt;/span&gt;[] StreamData {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;get&lt;/span&gt; { &lt;span style="color:blue;"&gt;return&lt;/span&gt; streamData; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;set&lt;/span&gt; { SetPropertyValue(&lt;span style="color:#a31515;"&gt;&amp;quot;StreamData&amp;quot;&lt;/span&gt;, &lt;span style="color:blue;"&gt;ref&lt;/span&gt; streamData, &lt;span style="color:blue;"&gt;value&lt;/span&gt;); }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;private&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Guid&lt;/span&gt; streamId;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; [&lt;span style="color:#2b91af;"&gt;DbType&lt;/span&gt;(&lt;span style="color:#a31515;"&gt;&amp;quot;uniqueidentifier ROWGUIDCOL UNIQUE NOT&amp;quot;&lt;/span&gt;)]&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Guid&lt;/span&gt; StreamId {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;get&lt;/span&gt; { &lt;span style="color:blue;"&gt;return&lt;/span&gt; streamId; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;set&lt;/span&gt; { SetPropertyValue(&lt;span style="color:#a31515;"&gt;&amp;quot;StreamId&amp;quot;&lt;/span&gt;, &lt;span style="color:blue;"&gt;ref&lt;/span&gt; streamId, &lt;span style="color:blue;"&gt;value&lt;/span&gt;); }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; }&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;This code removes the need for any separate structural updates, which is of course very convenient. Now, in my previous post I had already mentioned I&amp;#39;d been playing with ways of using the DbTypeAttribute, and my solution had looked almost exactly the same - only I hadn&amp;#39;t been aware that the UNIQUE keyword could be used in that precise way, and so I wasn&amp;#39;t able to get the necessary index created on the ROWGUIDCOL field. Boris&amp;#39; code takes care of that now.&lt;/p&gt;
&lt;p&gt;Is this preferable? I&amp;#39;m not entirely sure. I had one other reason to decide not to post my own similar code in my previous article, and that was the fact that the DbType parameter for the StreamId field looks very much like SQL injection. As you can see, it ends in &amp;quot;NOT&amp;quot;, and that is to combine with the &amp;quot;NULL&amp;quot; that XPO inserts into the SQL code anyway, so the field ends up being &amp;quot;NOT NULL&amp;quot;. Hm... I guess this is SQL injection, seeing how the text from the DbType is inserted into the DML code without any checks. Then again, that&amp;#39;s the exact point of having a DbType attribute in the first place - the ability to use types that XPO isn&amp;#39;t aware of - and of course it&amp;#39;s compile time data that is injected. In the end, that code has the same effect as the other code I published previously. It is important to point out that while this may look similar to code used for SQL injection attacks, it&amp;#39;s quite a different thing really, and there doesn&amp;#39;t seem to be a way of exploiting this at runtime.&lt;/p&gt;
&lt;p&gt;So is it preferable? I don&amp;#39;t know - I guess it&amp;#39;s more convenient to use in some cases. It&amp;#39;s also less dynamic. With the code I published previously, it would be possible for the initialization code to determine whether SQL Server 2008 is being used, and to make the necessary changes only if it is. By decorating the field with the DbType attribute, the class can only be used with SQL Server 2008. I guess in the end everybody will have to decide for themselves.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Update:&lt;/b&gt; Another idea from one of our untiring XPO team members - Alex this time - you could use an XPCustomObject and establish a Guid type primary key. This will be marked with ROWGUIDCOL automatically (we introduced this originally to make the databases replication friendly) and of course it will have the required unique index. I actually had a similar idea early on, but I wasn&amp;#39;t going to do this because I didn&amp;#39;t want to mix the requirements of the FILESTREAM feature with other structure... Of course you&amp;#39;ll still have to get the FILESTREAM type set correctly and using DbType on that one still makes your structure specific to SQL Server 2008. I guess my own overall decision might still be to make the modifications through SQL/DML statements, but of course (as Alex also pointed out) I should pay attention whether my table has a Guid type primary key perhaps - in which case SQL Server will not let me establish a second column with the ROWGUIDCOL attribute set.&lt;/p&gt;
&lt;p&gt;Finally, &lt;a href="http://forums/p/67872/231221.aspx#231221"&gt;I was asked to show how initialization code can be used in the context of an XAF application&lt;/a&gt;. That&amp;#39;s actually very simple, since XAF has its own mechanism of updating database structure and content with new versions of applications. That mechanism can easily be used to call some structure modification code. &lt;a href="http://www.devexpress.com/Help/Content.aspx?help=ExpressApp&amp;amp;document=CustomDocument2795.htm"&gt;It&amp;#39;s documented in the XAF help here&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://community.devexpress.com/aggbug.aspx?PostID=231270" width="1" height="1"&gt;</description><category domain="http://community.devexpress.com/blogs/xpo/archive/tags/XPO/default.aspx">XPO</category></item><item><title>Installing Visual Studio SP1 wiped out my item templates</title><link>http://community.devexpress.com/blogs/ctodx/archive/2008/08/14/installing-visual-studio-sp1-wiped-out-my-item-templates.aspx</link><pubDate>Fri, 15 Aug 2008 01:25:50 GMT</pubDate><guid isPermaLink="false">bd716303-653c-428d-8b8a-a7d998cde032:231244</guid><dc:creator>Julian M Bucknall</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;Sounds like a conspiracy theory, so maybe I should put it all in caps, with spelling mistakes: INSTALING VISHUL STUDIO SP1 NUKKED MY DX NEW ITEMS IKONS. KTHXBYE.&lt;/p&gt; &lt;p&gt;A customer phoned me up this afternoon saying that he&amp;#39;d just installed DXperience Enterprise but couldn&amp;#39;t find any XtraReports items in his toolbox. He was worried in case the install had failed in some way. Ha, I thought, I&amp;#39;ll just walk him through creating a new application that has a report, and show that the XtraReports controls only show up in the toolbox if the designer is showing a report form. You know, that friendly CTO helping the customer thing.&lt;/p&gt; &lt;p&gt;So we started off together. Create a new solution, I said, and we did. OK, to add a report to this project, I said, we right-click and select New Item, and select XtraReports... WHERE THE HECK HAVE ALL MY ITEMS GONE?&lt;/p&gt; &lt;p&gt;For some unfathomable reason, installing SP1 had wiped all third-party item templates from this list. It was bare. No XAF, no XPO, no XtraReports, nothing. A tiny little tab still promised some DXCore items, but otherwise zip, nada, zilch. I shivered. &lt;/p&gt; &lt;p&gt;Meanwhile, I&amp;#39;m sure my customer was slowly backing away from the phone: the CTO of DevExpress doesn&amp;#39;t know how to create a simple XtraReports app? What the... I made some reassuring noises -- OK, maybe they were just noises -- and we finished the call with my abject apologies. &lt;/p&gt; &lt;p&gt;I had a look at my other machine which I use for travel. There I&amp;#39;d installed SP1 and DXperience 2008.2.2 (I was late in updating it on that machine) in that order, and, lo, the new items page was full.&lt;/p&gt; &lt;p&gt;So there was nothing for it but to uninstall XAF and DXperience and then reinstall them (hmm, now I write this perhaps Repair might have done the job in a shorter time) and full functionality was restored. So, if you run into this, you&amp;#39;ll know what to do. &lt;/p&gt; &lt;p&gt;Meanwhile, if you did call me this afternoon about XtraReports, I can lead you though the basics over the phone now. Honest &lt;img src="http://community.devexpress.com/emoticons/emotion-1.gif" alt="Smile" /&gt;.&lt;/p&gt;&lt;img src="http://community.devexpress.com/aggbug.aspx?PostID=231244" width="1" height="1"&gt;</description></item><item><title>Windows 7 news starts filtering out</title><link>http://community.devexpress.com/blogs/ctodx/archive/2008/08/14/windows-7-news-starts-filtering-out.aspx</link><pubDate>Thu, 14 Aug 2008 21:46:57 GMT</pubDate><guid isPermaLink="false">bd716303-653c-428d-8b8a-a7d998cde032:231237</guid><dc:creator>Julian M Bucknall</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Microsoft Senior VPs &lt;a href="http://www.microsoft.com/presspass/exec/ssinofsky/default.aspx"&gt;Steve Sinofsky&lt;/a&gt; and &lt;a href="http://www.microsoft.com/presspass/exec/devaan/"&gt;Jon DeVaan&lt;/a&gt; (the former in charge of Windows and Windows Live and the latter in charge of Windows Core Operating Systems) have started a new joint blog called &lt;a href="http://blogs.msdn.com/e7/default.aspx"&gt;Engineering Windows 7&lt;/a&gt; to talk about, well, Windows 7, the next version of Windows beyond Vista. So that would be Lost Horizon then (bada boom bada bing &lt;img src="http://community.devexpress.com/emoticons/emotion-1.gif" alt="Smile" /&gt;). &lt;/p&gt; &lt;p&gt;They&amp;#39;re going to be regularly blogging about the new things in Windows 7 all the way up to PDC (Professional Developers Conference)in October -- where already there&amp;#39;s a large number of sessions booked to talk about Windows 7 -- and WinHEC (Windows Hardware Engineering Conference) the week after. It seems that, after a virtual desert from the past couple of years, we&amp;#39;re going to be deluged with information until we&amp;#39;re drowning in the stuff.&lt;/p&gt; &lt;p&gt;The blog is bound to be interesting. My recommendation then is to subscribe to the RSS feed so you&amp;#39;re kept up to date with what they say. (Well, as soon as it&amp;#39;s ready; must be a Windows Live thing.)&lt;/p&gt; &lt;p&gt;(Er, Ray? I know that we&amp;#39;re a Platinum Sponsor of PDC this year and that we have a large booth &amp;#39;n&amp;#39; all and it&amp;#39;s likely to be a madhouse in the Exhibitor&amp;#39;s Hall, but could I have lots of time off to go to these sessions? Ray? Don&amp;#39;t walk away laughing hysterically, I&amp;#39;m asking a serious question. No, don&amp;#39;t switch the light off...)&lt;/p&gt;&lt;img src="http://community.devexpress.com/aggbug.aspx?PostID=231237" width="1" height="1"&gt;</description></item><item><title>XPO and SQL Server 2008 FILESTREAM support</title><link>http://community.devexpress.com/blogs/xpo/archive/2008/08/14/xpo-and-sql-server-2008-filestream-support.aspx</link><pubDate>Thu, 14 Aug 2008 16:48:00 GMT</pubDate><guid isPermaLink="false">bd716303-653c-428d-8b8a-a7d998cde032:231202</guid><dc:creator>Oliver Sturm (Developer Express)</dc:creator><slash:comments>4</slash:comments><description>&lt;p&gt;In &lt;a href="http://forums/p/67872/231168.aspx#231168"&gt;a recent forum post&lt;/a&gt;, Reinhold Erlacher asked me whether we supported the new FILESTREAM feature in SQL Server 2008 yet. I was not familiar with the feature, not being a SQL Server expert really, but I decided to have a look.&lt;/p&gt;
&lt;p&gt;First, I had to set up SQL Server to actually support the feature in question. A well documented process, but a bit weird nonetheless - why do they introduce features that are only available after jumping through so many additional hoops? Ah well... &lt;a href="http://msdn.microsoft.com/en-us/library/bb933995.aspx"&gt;Here are the instructions on MSDN&lt;/a&gt; - there&amp;#39;s a lot of confusing information around in blogs, apparently from pre-release versions of SQL Server 2008, so be sure to use these to get it to work with your database.&lt;/p&gt;
&lt;p&gt;Now, first I played around a bit to try and get XPO to create a database structure automatically that would be compatible with the FILESTREAM feature. That is not currently possible, as it turns out, since there are a few requirements:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The database must have a file group for the file streams&lt;/li&gt;
&lt;li&gt;A table that has associated file streams must also have a column marked ROWGUIDCOL&lt;/li&gt;
&lt;li&gt;The ROWGUIDCOL column must have a unique index applied&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Finally, of course, the blob column that will store the stream data must be marked FILESTREAM. We don&amp;#39;t support any of these things directly - i.e. through a built-in feature - in XPO, and I don&amp;#39;t think it&amp;#39;s likely that we will. Fortunately, it&amp;#39;s quite easy to make the necessary changes either manually (configuring the file group in SQL Server Management Studio) or automatically (using a bit of SQL code that&amp;#39;s executed after the default schema creation process from the XPO application). The process shouldn&amp;#39;t be hard to integrate with a typical deployment scenario, and of course we can&amp;#39;t help the fact that Microsoft have made it quite hard to benefit from the new feature.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using this basic persistent class for my demo:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="font-family:Consolas;font-size:11pt;color:black;background:white;"&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Something&lt;/span&gt;: &lt;span style="color:#2b91af;"&gt;XPObject&lt;/span&gt; {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; Something(&lt;span style="color:#2b91af;"&gt;Session&lt;/span&gt; session)&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; : &lt;span style="color:blue;"&gt;base&lt;/span&gt;(session) { }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;override&lt;/span&gt; &lt;span style="color:blue;"&gt;void&lt;/span&gt; AfterConstruction( ) {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;base&lt;/span&gt;.AfterConstruction( );&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; streamId = &lt;span style="color:#2b91af;"&gt;Guid&lt;/span&gt;.NewGuid( );&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;private&lt;/span&gt; &lt;span style="color:blue;"&gt;string&lt;/span&gt; strVal;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;string&lt;/span&gt; StrVal {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;get&lt;/span&gt; { &lt;span style="color:blue;"&gt;return&lt;/span&gt; strVal; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;set&lt;/span&gt; { SetPropertyValue(&lt;span style="color:#a31515;"&gt;&amp;quot;StrVal&amp;quot;&lt;/span&gt;, &lt;span style="color:blue;"&gt;ref&lt;/span&gt; strVal, &lt;span style="color:blue;"&gt;value&lt;/span&gt;); }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;private&lt;/span&gt; &lt;span style="color:blue;"&gt;byte&lt;/span&gt;[] streamData;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;byte&lt;/span&gt;[] StreamData {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;get&lt;/span&gt; { &lt;span style="color:blue;"&gt;return&lt;/span&gt; streamData; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;set&lt;/span&gt; { SetPropertyValue(&lt;span style="color:#a31515;"&gt;&amp;quot;StreamData&amp;quot;&lt;/span&gt;, &lt;span style="color:blue;"&gt;ref&lt;/span&gt; streamData, &lt;span style="color:blue;"&gt;value&lt;/span&gt;); }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;private&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Guid&lt;/span&gt; streamId;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Guid&lt;/span&gt; StreamId {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;get&lt;/span&gt; { &lt;span style="color:blue;"&gt;return&lt;/span&gt; streamId; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;set&lt;/span&gt; { SetPropertyValue(&lt;span style="color:#a31515;"&gt;&amp;quot;StreamId&amp;quot;&lt;/span&gt;, &lt;span style="color:blue;"&gt;ref&lt;/span&gt; streamId, &lt;span style="color:blue;"&gt;value&lt;/span&gt;); }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; }&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;I experimented briefly with the DbTypeAttribute and I had some success with it, but since custom SQL code was still required, I decided to make all relevant changes in one place instead of spreading them out. My test application is this:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="font-family:Consolas;font-size:11pt;color:black;background:white;"&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &lt;span style="color:blue;"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Program&lt;/span&gt; {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;static&lt;/span&gt; &lt;span style="color:blue;"&gt;void&lt;/span&gt; Main(&lt;span style="color:blue;"&gt;string&lt;/span&gt;[] args) {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#2b91af;"&gt;XpoDefault&lt;/span&gt;.DataLayer = &lt;span style="color:#2b91af;"&gt;XpoDefault&lt;/span&gt;.GetDataLayer(&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#2b91af;"&gt;MSSqlConnectionProvider&lt;/span&gt;.GetConnectionString(&lt;span style="color:#a31515;"&gt;&amp;quot;.&amp;quot;&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;&amp;quot;XPOFileStream&amp;quot;&lt;/span&gt;),&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#2b91af;"&gt;AutoCreateOption&lt;/span&gt;.DatabaseAndSchema);&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:green;"&gt;// This sets up the DB structure. Of course we would only do this &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:green;"&gt;// once in a real app. Since we&amp;#39;re boring in this sample, we&amp;#39;re just&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:green;"&gt;// going to kill the db and go from scratch.&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;using&lt;/span&gt; (&lt;span style="color:#2b91af;"&gt;UnitOfWork&lt;/span&gt; uow = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;UnitOfWork&lt;/span&gt;( )) {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; uow.ClearDatabase( );&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; CreateDBStructure( );&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:green;"&gt;// Create some test data&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;using&lt;/span&gt; (&lt;span style="color:#2b91af;"&gt;UnitOfWork&lt;/span&gt; uow = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;UnitOfWork&lt;/span&gt;( )) {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#2b91af;"&gt;Something&lt;/span&gt; something = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Something&lt;/span&gt;(uow);&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; something.StrVal = &lt;span style="color:#a31515;"&gt;&amp;quot;Entry&amp;quot;&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; something.StreamData = &lt;span style="color:#2b91af;"&gt;UTF8Encoding&lt;/span&gt;.Default.GetBytes(&lt;span style="color:#a31515;"&gt;&amp;quot;Stuff in my stream&amp;quot;&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; uow.CommitChanges( );&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:green;"&gt;// Read the object back and show the stream data&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;using&lt;/span&gt; (&lt;span style="color:#2b91af;"&gt;UnitOfWork&lt;/span&gt; uow = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;UnitOfWork&lt;/span&gt;( )) {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#2b91af;"&gt;Something&lt;/span&gt; something = uow.FindObject&amp;lt;&lt;span style="color:#2b91af;"&gt;Something&lt;/span&gt;&amp;gt;(&lt;span style="color:blue;"&gt;null&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#2b91af;"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color:#a31515;"&gt;&amp;quot;Stream says: &amp;quot;&lt;/span&gt; + &lt;span style="color:#2b91af;"&gt;UTF8Encoding&lt;/span&gt;.Default.GetString(something.StreamData));&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;private&lt;/span&gt; &lt;span style="color:blue;"&gt;static&lt;/span&gt; &lt;span style="color:blue;"&gt;void&lt;/span&gt; CreateDBStructure( ) {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:green;"&gt;// Get the basic db structure created&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;using&lt;/span&gt; (&lt;span style="color:#2b91af;"&gt;UnitOfWork&lt;/span&gt; uow = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;UnitOfWork&lt;/span&gt;( )) {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; uow.UpdateSchema(&lt;span style="color:blue;"&gt;typeof&lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;Something&lt;/span&gt;));&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:green;"&gt;// Apply schema modifications&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#2b91af;"&gt;Action&lt;/span&gt;&amp;lt;&lt;span style="color:blue;"&gt;string&lt;/span&gt;&amp;gt; execute = CommandExecutor(&lt;span style="color:#2b91af;"&gt;XpoDefault&lt;/span&gt;.DataLayer.Connection);&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; execute(&lt;span style="color:#a31515;"&gt;&amp;quot;alter table Something alter column StreamId uniqueidentifier not null&amp;quot;&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; execute(&lt;span style="color:#a31515;"&gt;&amp;quot;alter table Something alter column StreamId add rowguidcol&amp;quot;&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; execute(&lt;span style="color:#a31515;"&gt;&amp;quot;alter table Something add constraint streamid_unique unique(StreamId)&amp;quot;&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; execute(&lt;span style="color:#a31515;"&gt;&amp;quot;alter table Something drop column StreamData&amp;quot;&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; execute(&lt;span style="color:#a31515;"&gt;&amp;quot;alter table Something add StreamData varbinary(max) FILESTREAM&amp;quot;&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;static&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Action&lt;/span&gt;&amp;lt;&lt;span style="color:blue;"&gt;string&lt;/span&gt;&amp;gt; CommandExecutor(&lt;span style="color:#2b91af;"&gt;IDbConnection&lt;/span&gt; connection) {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:blue;"&gt;return&lt;/span&gt; &lt;span style="color:blue;"&gt;delegate&lt;/span&gt;(&lt;span style="color:blue;"&gt;string&lt;/span&gt; command) {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#2b91af;"&gt;SqlCommand&lt;/span&gt; sqlCommand = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;SqlCommand&lt;/span&gt;(command, (&lt;span style="color:#2b91af;"&gt;SqlConnection&lt;/span&gt;) connection);&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sqlCommand.ExecuteNonQuery( );&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp; }&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;You can download the complete sample from here (VS 2008 SP1): &lt;a href="http://community.devexpress.com/blogs/xpo/XPOSQL2008FileStream.zip"&gt;XPOSQL2008FileStream.zip&lt;/a&gt; (4267 bytes)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: If you try to run the sample out of the box, you will be in trouble because the database is not configured to support file streams! You should therefore create a database called &amp;quot;XPOFileStream&amp;quot; manually and set it up to support file streams correctly (again, &lt;a href="http://msdn.microsoft.com/en-us/library/bb933995.aspx"&gt;as described here&lt;/a&gt;), and then run the sample.&lt;/p&gt;&lt;img src="http://community.devexpress.com/aggbug.aspx?PostID=231202" width="1" height="1"&gt;</description><category domain="http://community.devexpress.com/blogs/xpo/archive/tags/XPO/default.aspx">XPO</category></item><item><title>New Refactoring Video: Extract to XAML Template</title><link>http://community.devexpress.com/blogs/markmiller/archive/2008/08/14/new-refactoring-video-extract-to-xaml-template.aspx</link><pubDate>Thu, 14 Aug 2008 14:23:00 GMT</pubDate><guid isPermaLink="false">bd716303-653c-428d-8b8a-a7d998cde032:231172</guid><dc:creator>Mark Miller (Developer Express)</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;Here&amp;#39;s another refactoring we&amp;#39;re working on for the 3.2 release,&amp;nbsp;&lt;a href="http://tv.devexpress.com/NewRefactorings2.movie"&gt;Extract to XAML Template&lt;/a&gt;. It moves an inlined control template up to the resource section of the file,&amp;nbsp;which promotes reuse of the template across multiple controls.&lt;/p&gt;
&lt;p&gt;Between now and the 3.2 release, existing CodeRush and Refactor! Pro customers can get a daily build from &lt;a href="mailto:support@devexpress.com"&gt;support@devexpress.com&lt;/a&gt; which includes this feature.&lt;/p&gt;&lt;img src="http://community.devexpress.com/aggbug.aspx?PostID=231172" width="1" height="1"&gt;</description></item><item><title>XPO Publication Service and XAF</title><link>http://community.devexpress.com/blogs/xpo/archive/2008/08/14/xpo-publication-service-and-xaf.aspx</link><pubDate>Thu, 14 Aug 2008 10:57:00 GMT</pubDate><guid isPermaLink="false">bd716303-653c-428d-8b8a-a7d998cde032:231132</guid><dc:creator>Oliver Sturm (Developer Express)</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;I was involved in some debugging action this morning, regarding my &lt;a href="http://community.devexpress.com/blogs/xpo/archive/2008/05/31/xpo-publication-service-update-for-8-1-4.aspx"&gt;XPO Publication Service&lt;/a&gt;. Please read &lt;a href="http://community.devexpress.com/blogs/xpo/archive/2008/05/31/xpo-publication-service-update-for-8-1-4.aspx"&gt;this post&lt;/a&gt; (and others linked from there) to find out the basics about that service.&lt;/p&gt;
&lt;p&gt;The &lt;a href="http://www.devexpress.com/issue=Q181274"&gt;problem in question&lt;/a&gt; was that a customer was receiving a weird Remoting exception when trying to connect to a data store published through the publication service. The first test I did was to change the dependencies in the service to 8.2, build it, and run my functional tests on it - all of those worked fine.&lt;/p&gt;
&lt;p&gt;So I set out to create a simple client that would attach itself to a data store published through the Publication Service. At this point, I think a little excursion would be good. I have noticed that many people have the weirdest ideas of how to connect to a published service from XPO. Often they involve a line like this:&lt;/p&gt;
&lt;pre&gt;IDataStore dataStore = (IDataStore)Activator.GetObject(typeof(IDataStore), 
  @&amp;quot;http://tcp:2635/something.rem&amp;quot;);
&lt;/pre&gt;
&lt;p&gt;Now, this is not wrong, but it&amp;#39;s also not necessary. Retrieving a reference from the Activator is one way of interfacing with the .NET Remoting infrastructure on the client side. But - that code is already contained in the XPO libraries, so all the gory details of using Remoting are hidden. You can easily use XPO to get a connection provider (= data store) created directly, like this:&lt;/p&gt;
&lt;pre&gt;XpoDefault.GetConnectionProvider(&amp;quot;tcp://localhost:9999/something.rem&amp;quot;, 
  AutoCreateOption.DatabaseAndSchema)
&lt;/pre&gt;
&lt;p&gt;Or, even better, you can get a data layer set up directly, like this:&lt;/p&gt;
&lt;pre&gt;XpoDefault.DataLayer = XpoDefault.GetDataLayer(&amp;quot;tcp://localhost:9999/something.rem&amp;quot;, 
  AutoCreateOption.DatabaseAndSchema);&lt;/pre&gt;
&lt;p&gt;What this means is really that a connection URL for a data store published through Remoting can be used in very similar places to any other connection string. XPO will figure it out for you.&lt;/p&gt;
&lt;p&gt;On a related note, guess how to set up an XAF application to connect to a data store publication? That&amp;#39;s right, just use the URL as a connection string. For instance, put this into your app.config:&lt;/p&gt;
&lt;pre&gt;&amp;lt;add name=&amp;quot;ConnectionString&amp;quot; connectionString=&amp;quot;tcp://localhost:9999/something.rem&amp;quot; /&amp;gt;
&lt;/pre&gt;
&lt;p&gt;Right, end of excursion. Now, I&amp;#39;d created that little client app and, in contrast to all the lines above, I was using HTTP, not TCP, for the connection. The publications.xml file for the Publication Service had this Channels section:&lt;/p&gt;
&lt;pre&gt;&amp;lt;Channels&amp;gt;
  &amp;lt;xpopub:HTTPTargetChannel&amp;gt;
    &amp;lt;Port&amp;gt;9999&amp;lt;/Port&amp;gt;
  &amp;lt;/xpopub:HTTPTargetChannel&amp;gt;
&amp;lt;/Channels&amp;gt;
&lt;/pre&gt;
&lt;p&gt;I was quite surprised to find this, but I got the same Remoting exception as described in &lt;a href="http://www.devexpress.com/issue=Q181274"&gt;the support center issue&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;One idea I quickly had was that the problem might be related to that other weird issue I had encountered at some point when using HTTP for a publication. That issue is described in this post on my personal blog, and it&amp;#39;s certainly not irrelevant if you use Remoting or some other protocol to publish things through HTTP. So go to &lt;a href="http://www.sturmnet.org/blog/archives/2008/02/08/net-3-the-game-challenge-at-vbug-newcastle/"&gt;this article&lt;/a&gt; and have a look if you&amp;#39;re interested.&lt;/p&gt;
&lt;p&gt;Anyway, that wasn&amp;#39;t it, since the error messages were different. Nevertheless, I was able to solve the problem by switching to TCP. Probably a good idea anyway, unless you specifically need to use HTTP for firewall reasons (though it will forever remain a mystery to me why people don&amp;#39;t have a problem tunneling unknown content through HTTP, while being scared $$(*&amp;amp;less by the same data on a different port). So I changed my publications.xml to this:&lt;/p&gt;
&lt;pre&gt;&amp;lt;Channels&amp;gt;
  &amp;lt;xpopub:TCPTargetChannel&amp;gt;
    &amp;lt;Port&amp;gt;9999&amp;lt;/Port&amp;gt;
  &amp;lt;/xpopub:TCPTargetChannel&amp;gt;
&amp;lt;/Channels&amp;gt;
&lt;/pre&gt;
&lt;p&gt;I changed all the URLs I was using to tcp://, as shown in the code lines above, and then it worked. Great. A quick test with the more complex XAF Main Demo application showed that this worked as well. Fine.&lt;/p&gt;
&lt;p&gt;So, back to the &amp;quot;why&amp;quot;... why is everything fine with TCP, but not with HTTP? Well, the answer came to me after some discussion with our support guy Dennis: the serialization formats don&amp;#39;t match. Yeah. Let me say that again - the serialization formats don&amp;#39;t match. Why doesn&amp;#39;t Remoting throw a TheSerializationFormatsDontMatchException? I don&amp;#39;t know. Anyway, that&amp;#39;s what&amp;#39;s happening.&lt;/p&gt;
&lt;p&gt;The XPO Publication Service defaults to binary encoding, even for the HTTP channel. There&amp;#39;s a property called UseBinaryEncoding on the channel, which can be changed through the config file, but it defaults to true. The XPO library, on the other hand, defaults to SOAP encoding when an HTTP channel is used. So, back to the publications.xml with the HTTPTargetChannel, and then insert this line before the code that establishes the connection to the server:&lt;/p&gt;
&lt;pre&gt;ChannelServices.RegisterChannel(new HttpChannel(null, 
  new BinaryClientFormatterSinkProvider(), null), false);
&lt;/pre&gt;
&lt;p&gt;Credit for this line goes to Dennis - he had found out that this makes things work, though he wasn&amp;#39;t exactly sure why. Here&amp;#39;s why: because the HTTP Channel is configured to use binary encoding and thereby becomes compatible with the way the Publication Service works. The XPO library doesn&amp;#39;t register the HTTP Channel again, since it&amp;#39;s already there, and it doesn&amp;#39;t change the registration either. Fine.&lt;/p&gt;
&lt;p&gt;Now, several questions come up here. First, why are the Publication Service and the XPO defaults incompatible? I don&amp;#39;t know. It&amp;#39;s certainly weird and I suspect we changed something at some point, on one or both ends. It&amp;#39;s been a long time since I wrote the Publication Service and being a pet project, it&amp;#39;s perhaps not tested well enough - still, since we&amp;#39;re talking about default settings here, it seems that this could have been found earlier if it had been like that forever. I don&amp;#39;t know.&lt;/p&gt;
&lt;p&gt;Second, is it possible to use SOAP encoding? Yes and no, oddly enough - another point where I&amp;#39;m not sure where a problem comes from. It is easy to switch the Publication Service to using SOAP, like this:&lt;/p&gt;
&lt;pre&gt;&amp;lt;Channels&amp;gt;
  &amp;lt;xpopub:HTTPTargetChannel&amp;gt;
    &amp;lt;Port&amp;gt;9999&amp;lt;/Port&amp;gt;
    &amp;lt;UseBinaryEncoding&amp;gt;false&amp;lt;/UseBinaryEncoding&amp;gt;
  &amp;lt;/xpopub:HTTPTargetChannel&amp;gt;
&amp;lt;/Channels&amp;gt;
&lt;/pre&gt;
&lt;p&gt;The problem is, when I tried this, I got another weird exception coming up, saying that the SOAP formatter isn&amp;#39;t able to deal with generic classes being serialized. Okay then... hm. The point where we changed XPO to have generic classes involved in the inheritance hierarchy is a really long time ago, so it&amp;#39;s probably been like that since then. Interestingly, while I don&amp;#39;t know how many people use Remoting with HTTP/SOAP, I&amp;#39;m pretty sure there are some people using XML Web Services, which use HTTP/SOAP as well. The answer to that is that the SOAP formatter for Remoting isn&amp;#39;t the same as the one for XML Web Services. And they are both different from the one being used for WCF, if I&amp;#39;m not completely mistaken. Trust Microsoft to find ways of making complex things more confusing.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Summary of all the odd stuff above&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;If you&amp;#39;ve stopped reading my ramblings a while ago, here&amp;#39;s the summary of important points:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The reason for &lt;a href="http://www.devexpress.com/issue=Q181274"&gt;the issue&lt;/a&gt; is that the XPO Publication Service and the Remoting client code in the XPO libraries use different formatter defaults for the HTTP channel. We should look into making some changes so this would be compatible automatically.&lt;/li&gt;
&lt;li&gt;Using TCP instead of HTTP makes things work. This is probably the best idea for many cases, unless HTTP is absolutely required.&lt;/li&gt;
&lt;li&gt;Using binary formatting with HTTP also makes things work. An additional line of code is required for this purpose, but inserting this into application initialization code shouldn&amp;#39;t be a problem in most cases.&lt;/li&gt;
&lt;li&gt;Using SOAP formatting with the Publication Service is easy, but it doesn&amp;#39;t actually work for technical reasons in the Remoting SOAP formatter. We might look into this in a bit more detail to see if there&amp;#39;s anything we can do about this.&lt;/li&gt;
&lt;li&gt;Using the HTTP/SOAP combination is perfectly possible with XML Web Services as well as WCF, to my knowledge. XML Web Services are not self-hosting, so they can&amp;#39;t really be supported by the XPO Publication Service. WCF can be self-hosting and it would be possible to extend the Publication Service to support it directly. The Publication Service can be extended externally, i.e. without changes to its own code base. With or without support in the Publication Service, there are plenty of articles on this blog that show how to tunnel through Web Services and WCF.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;b&gt;Update:&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve talked to the XPO team, and they have tracked down the problem with the SOAP formatter. Turns out this should actually work - so we regard it a bug and it will be fixed. Hang on... just now an IM tells me that the fix has been checked in internally. Will be in the next minor release.&lt;/p&gt;
&lt;p&gt;The thing with the default behavior of the XPO Remoting code is that it uses defaults the .NET Framework provides, which is a good thing of course. I guess it would make sense to change the default for the Publication Service to use SOAP instead of binary... I&amp;#39;ll probably do that soon.&lt;/p&gt;&lt;img src="http://community.devexpress.com/aggbug.aspx?PostID=231132" width="1" height="1"&gt;</description><category domain="http://community.devexpress.com/blogs/xpo/archive/tags/XPO/default.aspx">XPO</category></item><item><title>Silverlight Control Builder Contest '08 complete</title><link>http://community.devexpress.com/blogs/ctodx/archive/2008/08/13/silverlight-control-builder-contest-08-complete.aspx</link><pubDate>Thu, 14 Aug 2008 01:29:48 GMT</pubDate><guid isPermaLink="false">bd716303-653c-428d-8b8a-a7d998cde032:231083</guid><dc:creator>Julian M Bucknall</dc:creator><slash:comments>9</slash:comments><description>&lt;p&gt;A couple of days ago the &lt;a href="http://www.pandora.com/"&gt;Silverlight Control Builder Contest &amp;#39;08&lt;/a&gt; that &lt;a href="http://pagebrooks.com/"&gt;Page Brooks&lt;/a&gt; organized came to an end. He&amp;#39;d managed to convince a whole bunch of vendors like ourselves to pony up prizes (ours was a subscription to DXperience Universal and a $500 gift certificate to NewEgg) and had managed to amass something like $17,000 worth.&lt;/p&gt; &lt;p&gt;So how did it go? Well, unfortunately that was a problem. Only one person entered, Faisal Waris, and of course he won. Despite this, he didn&amp;#39;t win with a piddly progressbar control or something, but instead created &lt;a href="http://objectpeddler.com/feg/FlickrFEGTestTestPage.aspx"&gt;a stunning FishEyeGrid control&lt;/a&gt; for Silverlight -- you should certainly go and check it out. (Note, for some reason it wasn&amp;#39;t working for me in Firefox 3, so use IE7.) Certainly a worthy winner.&lt;/p&gt; &lt;p&gt;Many congratulations to Faisal. The part of your prize from DevExpress is on its way.&lt;/p&gt; &lt;p&gt;But my post is not about Faisal&amp;#39;s winning entry, it&amp;#39;s about what went awry. Why only one entrant? That&amp;#39;s a real shame. I came up with some thoughts:&lt;/p&gt; &lt;p&gt;1. The competition was for US developers only. As it happens, I can understand this: in the past we&amp;#39;ve looked at whether we could organize a competition in the same vein as this and the legalities can be overwhelming. Just in the US there are rules and laws about giving away prizes (for instance, the rule that everyone has heard of: &amp;quot;No purchase necessary&amp;quot;). I can&amp;#39;t imagine what it&amp;#39;s like in other countries; it could be there&amp;#39;s tax liabilities or to give away a prize you have to have a legal office/address in that country, for example. Anyway, in this international, interconnected day and age it&amp;#39;s all a bit of a mess.&lt;/p&gt; &lt;p&gt;2. It&amp;#39;s hard creating controls for Silverlight. OK, I&amp;#39;m being more jokey than serious. &lt;/p&gt; &lt;p&gt;3. Silverlight is still too new for many people to have gained expertise in writing controls. Applications, maybe; controls, not so much. This is perhaps a better reason than 2. Although there is a lot of buzz about Silverlight 2, it &lt;em&gt;is&lt;/em&gt; still in beta and not many workplaces will be using it yet, or even experimenting with it. So without work-related experience, you&amp;#39;re left to play around with it at home in your spare time. And of course, there&amp;#39;s a lot from Microsoft in the same space jockeying for your attention and learning abilities (WPF, ASP.NET MVC, etc). And, to be honest, not many people write controls (and most of them would be working for companies like Developer Express &lt;img src="http://community.devexpress.com/emoticons/emotion-5.gif" alt="Wink" /&gt;.&lt;/p&gt; &lt;p&gt;4. There wasn&amp;#39;t enough time. A difficult one this: you want to give the potential contestants well enough time to experiment and design and write something, but you don&amp;#39;t want to make it so long that the buzz dissipates and people say &amp;quot;uh, what contest?&amp;quot;&lt;/p&gt; &lt;p&gt;5. It takes a lot of time to create a compelling control that would win a competition. And as we all know, time equals money. Perhaps the $17,000 of prizes didn&amp;#39;t have enough in gift cards/money/cheques to make it worthwhile. Sure it&amp;#39;s nice to have the top of the range products from us and our fellow prize-giving vendors, but in the end a lot of the contestant&amp;#39;s spare time goes into this. I calculate $1000 in certificates that can be used to buy &amp;quot;stuff&amp;quot; to repay your efforts for the first prize, $475 for second place, $200 for third place. Maybe that&amp;#39;s not compelling enough to sink many tens of hours into the contest.&lt;/p&gt; &lt;p&gt;6. There was no registration. Without that Page had no real idea about how many people were considering entering the contest nor who they were, so he couldn&amp;#39;t email all the registrants a week from the end to say, how are you doing?, are you going to finish? Without that knowledge, it becomes hard to make a decision to, say, extend the contest another week. With registration, more people might have persevered -- it&amp;#39;s like signing up for a beta, you tend to feel compelled to try it out.&lt;/p&gt; &lt;p&gt;Nevertheless, it was a good contest and, as I say, well organized by Page and we all got a great control from Faisal that everyone can use. &lt;/p&gt;&lt;img src="http://community.devexpress.com/aggbug.aspx?PostID=231083" width="1" height="1"&gt;</description></item><item><title>New Refactoring Video: Extract Method to Type</title><link>http://community.devexpress.com/blogs/markmiller/archive/2008/08/13/new-refactoring-video-extract-method-to-type.aspx</link><pubDate>Wed, 13 Aug 2008 13:35:00 GMT</pubDate><guid isPermaLink="false">bd716303-653c-428d-8b8a-a7d998cde032:231011</guid><dc:creator>Mark Miller (Developer Express)</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;This is one of my favorite new refactorings coming up in the 3.2 release of Refactor! Pro. It&amp;#39;s called &lt;strong&gt;Extract Method to Type&lt;/strong&gt;, and it allows you to extract a block of code from one class to another class better suited to host the code block.&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s a &lt;a href="http://tv.devexpress.com/NewRefactorings1.movie"&gt;video&lt;/a&gt; showing this refactoring in action. I love the sub-menu allowing you to select both the target class and the calling local (when multiple target classes&amp;nbsp;and calling locals exist).&lt;/p&gt;
&lt;p&gt;While 3.2 is not released as of this writing, CodeRush and Refactor! Pro customers can get the latest daily builds from &lt;a href="mailto:support@devexpress.com"&gt;support@devexpress.com&lt;/a&gt; to have access to this feature right now. If you get a daily build and have a chance to try out this refactoring, let me know what you think.&lt;/p&gt;&lt;img src="http://community.devexpress.com/aggbug.aspx?PostID=231011" width="1" height="1"&gt;</description></item><item><title>DXperience and CodeRush Awards at TechEd 2008</title><link>http://community.devexpress.com/blogs/thinking/archive/2008/08/12/dxperience-and-coderush-awards-at-teched-2008.aspx</link><pubDate>Tue, 12 Aug 2008 22:26:00 GMT</pubDate><guid isPermaLink="false">bd716303-653c-428d-8b8a-a7d998cde032:230924</guid><dc:creator>Developer Express - Ray</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Though a bit late in posting this, SQL Server magazine has published a&amp;nbsp;short video on&amp;nbsp;the awards we received this year&amp;nbsp;at TechEd 2008.&lt;/p&gt;
&lt;p&gt;The video can be viewed here: &lt;span style="font-size:11pt;color:#1f497d;font-family:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;a href="http://ittv.net/DesktopModules/UltraVideoGallery/UltraVideoGallery.swf?vId=96&amp;amp;portalId=0"&gt;http://ittv.net/DesktopModules/UltraVideoGallery/UltraVideoGallery.swf?vId=96&amp;amp;portalId=0&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://community.devexpress.com/aggbug.aspx?PostID=230924" width="1" height="1"&gt;</description></item><item><title>.NET Framework Assistant</title><link>http://community.devexpress.com/blogs/ctodx/archive/2008/08/11/net-framework-assistant.aspx</link><pubDate>Tue, 12 Aug 2008 00:16:17 GMT</pubDate><guid isPermaLink="false">bd716303-653c-428d-8b8a-a7d998cde032:230753</guid><dc:creator>Julian M Bucknall</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;When you install the .NET Framework 3.5 SP1 that was released today, and you&amp;#39;re running Firefox 3 as your browser &lt;em&gt;du choix&lt;/em&gt;, the next time you run Firefox you&amp;#39;ll get the Add-Ons dialog showing you that a new add-on has been installed. &lt;/p&gt; &lt;p&gt;&lt;a href="http://community.devexpress.com/blogs/ctodx/WindowsLiveWriter/3ba47e579008.NETFrameworkAssistant_100F5/image_2.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="179" alt="image" src="http://community.devexpress.com/blogs/ctodx/WindowsLiveWriter/3ba47e579008.NETFrameworkAssistant_100F5/image_thumb.png" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Funny that, I don&amp;#39;t remember okaying that particular choice, but anyway. I&amp;#39;m about to install SP1 on another machine, so I&amp;#39;ll look out for it.&lt;/p&gt; &lt;p&gt;This add-on provides click-once support for Firefox and also will report back to whatever web server is asking the latest version of .NET that you&amp;#39;re using. Back in May, &lt;a href="http://weblogs.asp.net/scottgu/archive/2008/05/12/visual-studio-2008-and-net-framework-3-5-service-pack-1-beta.aspx"&gt;Scott Guthrie reported&lt;/a&gt; that this would be part of the SP1 beta, although it&amp;#39;s fun to try and find it:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;ClickOnce Client Application Deployment Improvements&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt; &lt;ul&gt; &lt;li&gt;...blah blah...&lt;/li&gt; &lt;li&gt;FireFox browser extension to support Clickonce installations using FireFox browsers&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt; &lt;p&gt;Just a friendly heads-up from your homies at DevExpress...&lt;/p&gt;&lt;img src="http://community.devexpress.com/aggbug.aspx?PostID=230753" width="1" height="1"&gt;</description></item><item><title>Visual Studio 2008 Service Pack 1 Released!</title><link>http://community.devexpress.com/blogs/aspnet/archive/2008/08/11/visual-studio-2008-service-pack-1-released-download-recommended.aspx</link><pubDate>Mon, 11 Aug 2008 23:15:00 GMT</pubDate><guid isPermaLink="false">bd716303-653c-428d-8b8a-a7d998cde032:230732</guid><dc:creator>Mehul Harry (Developer Express)</dc:creator><slash:comments>15</slash:comments><description>&lt;p&gt;Service Pack 1 for Visual Studio 2008 and .NET Framework 3.5 is out now. We had a chance to work with Microsoft on some of the &lt;a href="http://community.devexpress.com/blogs/aspnet/archive/2008/05/16/visual-studio-2008-sp1-beta-and-performance.aspx" target="_blank"&gt;issues and suggestions&lt;/a&gt; that many of you have recommend. Microsoft has listened and come out with a good service pack. It addresses many of the issues as well as include fixes, new features, and improvements:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Check out the full post on &lt;a href="http://blogs.msdn.com/somasegar/archive/2008/08/11/service-pack-1-for-vs-2008-and-net-fx-3-5-released.aspx" target="_blank"&gt;Somasegar’s blog&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/vstudio/products/cc533447.aspx" target="_blank"&gt;List of improvements and details&lt;/a&gt; on the service pack &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;[Update thanks to Glenn and Heather:] If you have the beta (and some other KB hotfixes) installed, then run the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=A494B0E0-EB07-4FF1-A21C-A4663E456D9D&amp;amp;displaylang=en" target="_blank"&gt;Visual Studio 2008 Service Pack Preparation Tool&lt;/a&gt; FIRST.&lt;/p&gt;  &lt;p&gt;Click the button to download Service Pack 1 for Visual Studio 2008 and .NET Framework 3.5: &lt;/p&gt;  &lt;p&gt;&lt;a href="http://go.microsoft.com/?linkid=8835254" target="_blank"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" title="image" border="0" alt="image" src="http://community.devexpress.com/blogs/aspnet/WindowsLiveWriter/VisualStudio2008ServicePack1ReleasedDown_CDB4/image_3.png" width="118" height="27" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;PS - After installation, leave a comment here on how you like the new improvements, features and fixes.&lt;/p&gt;&lt;img src="http://community.devexpress.com/aggbug.aspx?PostID=230732" width="1" height="1"&gt;</description><category domain="http://community.devexpress.com/blogs/aspnet/archive/tags/ASPxGridView+ASP.NET/default.aspx">ASPxGridView ASP.NET</category><category domain="http://community.devexpress.com/blogs/aspnet/archive/tags/ASPxperience/default.aspx">ASPxperience</category><category domain="http://community.devexpress.com/blogs/aspnet/archive/tags/ASPxMenu/default.aspx">ASPxMenu</category><category domain="http://community.devexpress.com/blogs/aspnet/archive/tags/VS2008/default.aspx">VS2008</category><category domain="http://community.devexpress.com/blogs/aspnet/archive/tags/Service+Pack/default.aspx">Service Pack</category><category domain="http://community.devexpress.com/blogs/aspnet/archive/tags/ASPxTreeList/default.aspx">ASPxTreeList</category><category domain="http://community.devexpress.com/blogs/aspnet/archive/tags/ASPxHtmlEditor/default.aspx">ASPxHtmlEditor</category><category domain="http://community.devexpress.com/blogs/aspnet/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://community.devexpress.com/blogs/aspnet/archive/tags/ASP.NET+GridView/default.aspx">ASP.NET GridView</category></item><item><title>Is .NET too successful?</title><link>http://community.devexpress.com/blogs/ctodx/archive/2008/08/11/is-net-too-successful.aspx</link><pubDate>Mon, 11 Aug 2008 22:04:20 GMT</pubDate><guid isPermaLink="false">bd716303-653c-428d-8b8a-a7d998cde032:230736</guid><dc:creator>Julian M Bucknall</dc:creator><slash:comments>8</slash:comments><description>&lt;p&gt;Over the past few months I&amp;#39;ve been reading of rumblings in the .NET blogosphere about the directions Microsoft is taking with .NET. &lt;/p&gt; &lt;p&gt;The poster child for these rumblings is the dichotomy between LINQ to SQL and the ADO Entity Framework (EF). Both in essence are used to get data from your database engine into your .NET application, both implement an ORM (object-relational mapping), but it&amp;#39;s not really clear which one to use. So there&amp;#39;s a whole cottage industry that&amp;#39;s grown up around this, with many august commentators opining for their readers which they&amp;#39;d go for (just google for &lt;a href="http://www.google.com/search?hl=en&amp;amp;q=&amp;quot;LINQ+to+SQL&amp;quot;+&amp;quot;Entity+Framework&amp;quot;"&gt;&amp;quot;LINQ to SQL&amp;quot; &amp;quot;Entity Framework&amp;quot;&lt;/a&gt;).&lt;/p&gt; &lt;p&gt;It turns out the reason there are two frameworks that have such wide overlap is that, ta-da!, they were written by two different teams at Microsoft. LINQ to SQL was written by the C# team, whereas EF came about through some long-winded gestation (I&amp;#39;m visualizing that scene from one of the Lord of the Rings movies where you see the orcs been &amp;quot;born&amp;quot;) from something called Object Spaces and is owned by the ADO.NET team. LINQ to SQL was recently given over to the ADO.NET team. &lt;/p&gt; &lt;p&gt;Roger Jennings, in &lt;a href="http://oakleafblog.blogspot.com/2008/05/is-adonet-team-abandoning-linq-to-sql.html"&gt;a post from May&lt;/a&gt; this year, wonders whether the ADO.NET team are just going to abandon LINQ to SQL. It&amp;#39;s crippled in the sense that it only works with SQL Server and, as I said, there&amp;#39;s a great deal of overlap between it, and EF. Why have 2 official ORMs when just having one will do?&lt;/p&gt; &lt;p&gt;And another example: the Patterns and Practices (P&amp;amp;P) group at Microsoft have been producing &amp;quot;best practices&amp;quot; type libraries, such as CAB, for a long time. Last year, just before TechEd, there was a flurry of information about a new product codenamed Acropolis that seemed to replicate a lot of what the P&amp;amp;P group were doing, but in a shiny new framework with designer support in Visual Studio. By October it had gone, its ideas to be subsumed in P&amp;amp;P and eventually the .NET framework itself. P&amp;amp;P has expanded its repertoire of libraries since.&lt;/p&gt; &lt;p&gt;And of course we have WPF, WCF and WF, all frameworks that expand on the basic .NET Framework. Ditto ASP.NET MVC. Poor old Visual Studio just can&amp;#39;t keep up, which is unfortunate since they all really need VS&amp;#39;s discoverability and designers to make them easier to use. So there&amp;#39;s more blogging advice from august commentators...&lt;/p&gt; &lt;p&gt;The .NET Framework no longer seems to be single and indivisible. Instead it&amp;#39;s turning into this multiheaded hydra, a victim of its own ease-of-use and productivity enhancers. Different teams at Microsoft seem to be producing libraries and frameworks as quickly as possible without anyone having much of any control over the process to try and unify them. David Worthington of SD Times seems to have a key to someone&amp;#39;s filing cabinet at Microsoft, since he&amp;#39;s quoting from yet another internal memo about exactly this issue in &lt;a href="http://www.sdtimes.com/content/article.aspx?ArticleID=32690"&gt;his latest article&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;I don&amp;#39;t know quite honestly what the answer to this might be. In one sense, it&amp;#39;s great to get all this functionality flowing out of Microsoft. On the other, it just makes the whole process of developing with the .NET Framework that much more complex. Also, looking at it from our viewpoint, should we try and support everything that it makes sense for us to do? Wouldn&amp;#39;t that spread us too thin, meaning our existing products and customers getting reduced love, but getting more marketing hits for new anemic products that support the latest framework/library? Or should we be more cautious, and test the waters a little with some experimental products before jumping in or retiring? &lt;/p&gt; &lt;p&gt;This is all a shame since the .NET universe was so much simpler than the previous COM and ActiveX universe. Are we getting to the point when another super abstraction is needed to make .NET simpler. together with full support in Visual Studio?&lt;/p&gt;&lt;img src="http://community.devexpress.com/aggbug.aspx?PostID=230736" width="1" height="1"&gt;</description></item><item><title>Return on Investment with Developer Tools, part II</title><link>http://community.devexpress.com/blogs/markmiller/archive/2008/08/11/return-on-investment-with-developer-tools-part-ii.aspx</link><pubDate>Mon, 11 Aug 2008 21:48:00 GMT</pubDate><guid isPermaLink="false">bd716303-653c-428d-8b8a-a7d998cde032:230888</guid><dc:creator>Mark Miller (Developer Express)</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;A while back I talked about calculating &lt;strong&gt;return on investment &lt;/strong&gt;for developer tools. That post brought in great comments pointing out limitations in a few assumptions made, including:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Some shops average &lt;strong&gt;more &lt;/strong&gt;than eight hour days or five day weeks.&lt;/li&gt;
&lt;li&gt;Many devs spend &lt;strong&gt;only a portion &lt;/strong&gt;of their day actually writing new code or maintaining existing code.&lt;/li&gt;
&lt;li&gt;Most devs &lt;strong&gt;work less &lt;/strong&gt;than the 50 weeks per year used in the original spreadsheet.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So, I&amp;#39;m back with a &lt;a href="http://community.devexpress.com/blogs/markmiller/Developer%20Tool%20Return%20On%20Investment.xls"&gt;revised spreadsheet&lt;/a&gt;, one that allows you to more accurately describe your work year, as well as how much time team members actually spend coding per day. The result is a more accurate picture of how much time it takes to achieve ROI. Many of the cells have comments to explain their values.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://community.devexpress.com/blogs/markmiller/Developer%20Tool%20Return%20On%20Investment.xls"&gt;&lt;img width="729" src="http://community.devexpress.com/blogs/markmiller/Images/ReturnOnInvestmentForDevTools.png" alt="Return on Investment" height="316" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This spreadsheet also adds a field for &lt;strong&gt;Developer Gain&lt;/strong&gt;, a value in man-months that represents the amount of dev time gained due to the productivity boost. Even for a small 3-dev team with each member spending an average of 5 hours a day writing or maintaining code, Developer Gain for CodeRush and Refactor! Pro still adds up to over five additional developer man-months every year.&lt;/p&gt;
&lt;p&gt;Take a look at the spreadsheet and let me know what you think.&lt;/p&gt;&lt;img src="http://community.devexpress.com/aggbug.aspx?PostID=230888" width="1" height="1"&gt;</description></item><item><title>New VCL spell checking component</title><link>http://community.devexpress.com/blogs/ctodx/archive/2008/08/07/new-vcl-spell-checking-component.aspx</link><pubDate>Thu, 07 Aug 2008 21:27:00 GMT</pubDate><guid isPermaLink="false">bd716303-653c-428d-8b8a-a7d998cde032:230370</guid><dc:creator>Julian M Bucknall</dc:creator><slash:comments>11</slash:comments><description>&lt;p&gt;Alongside the new version of our VCL pivot table control, ExpressPivotGrid 2, that Ray introduced &lt;a href="http://community.devexpress.com/blogs/thinking/archive/2008/08/06/vcl-pivot-grid-version-2-is-on-its-way.aspx"&gt;here&lt;/a&gt;, we are debuting our new spell checking component, ExpressSpellChecker, in the same release.&lt;/p&gt;
&lt;p&gt;This component provides you with an uncomplicated way in which you can add Microsoft&amp;reg; Office&amp;reg; style spell checking capabilities into your next Windows&amp;reg; application. Features include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Built-in support for &lt;a href="http://lasr.cs.ucla.edu/geoff/ispell-dictionaries.html"&gt;Ispell&lt;/a&gt; and &lt;a href="http://lingucomponent.openoffice.org/"&gt;OpenOffice&lt;/a&gt; dictionaries.  &lt;/li&gt;
&lt;li&gt;The ability to check text in standard text editors as well as in DevExpress text input controls. &lt;/li&gt;
&lt;li&gt;If you do use text input controls from Developer Express, words that aren&amp;#39;t in the dictionary can be underlined.  &lt;/li&gt;
&lt;li&gt;The &lt;b&gt;ExpressSpellChecker&lt;/b&gt; automatically checks spelling as you type, word by word. This is done in a separate thread without affecting the responsiveness of your UI. &lt;/li&gt;
&lt;li&gt;Custom dictionary support is provided and uses a plain text format.  &lt;/li&gt;
&lt;li&gt;Dictionary dialogs allow end-users to add unrecognized words to a dictionary, so that they can build a custom word list as they work.  &lt;/li&gt;
&lt;li&gt;There is a choice of two error indication dialogs, the dialogs that allow users to correct spelling mistakes. Both replicate dialogs found in Microsoft Office:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://community.devexpress.com/blogs/ctodx/WindowsLiveWriter/NewVCLspellcheckingcomponent_D951/image_6.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" alt="image" src="http://community.devexpress.com/blogs/ctodx/WindowsLiveWriter/NewVCLspellcheckingcomponent_D951/image_thumb_2.png" border="0" width="240" height="159" /&gt;&lt;/a&gt;  &lt;/li&gt;
&lt;li&gt;Pre-built Options editor. Options include the ability to ignore emails, URLs, mixed case/upper-case words, repeated words and words with numbers within them: &lt;br /&gt;&lt;br /&gt;&lt;a href="http://community.devexpress.com/blogs/ctodx/WindowsLiveWriter/NewVCLspellcheckingcomponent_D951/image_4.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" alt="image" src="http://community.devexpress.com/blogs/ctodx/WindowsLiveWriter/NewVCLspellcheckingcomponent_D951/image_thumb_1.png" border="0" width="240" height="234" /&gt;&lt;/a&gt;  &lt;/li&gt;
&lt;li&gt;You can force the spell checker to start scanning the text from the current cursor position or to check the current selection first.  &lt;/li&gt;
&lt;li&gt;Error correction can be done using a customizable built-in context menu:&lt;br /&gt;&lt;br /&gt; &lt;a href="http://community.devexpress.com/blogs/ctodx/WindowsLiveWriter/NewVCLspellcheckingcomponent_D951/image_2.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" alt="image" src="http://community.devexpress.com/blogs/ctodx/WindowsLiveWriter/NewVCLspellcheckingcomponent_D951/image_thumb.png" border="0" width="240" height="163" /&gt;&lt;/a&gt;  &lt;/li&gt;
&lt;li&gt;The &lt;b&gt;ExpressSpellChecker&lt;/b&gt;&amp;#39;s API includes methods to spell check an arbitrary string, the content of a text editor, or the content of all text editor controls within a specified container.  &lt;/li&gt;
&lt;li&gt;The spell checker provides a complete set of events to allow you to manage the spell checking process - including the suppression of built-in forms, modifications to suggestion lists, skipped words, manual error processing, etc. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The Developer Express VCL spell-checking component will be available with the &lt;a href="http://www.devexpress.com/Products/VCL/Subscription/"&gt;VCL Subscription&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;[Supported compilers: Delphi 7, Delphi 2005, Delphi 2006, Delphi 2007, C++Builder 2007]&lt;/p&gt;&lt;img src="http://community.devexpress.com/aggbug.aspx?PostID=230370" width="1" height="1"&gt;</description></item><item><title>Redirect Callback using an ASPxHttpHandler Module</title><link>http://community.devexpress.com/blogs/aspnet/archive/2008/08/07/redirect-callback-using-an-aspxhttphandler-module.aspx</link><pubDate>Thu, 07 Aug 2008 20:51:00 GMT</pubDate><guid isPermaLink="false">bd716303-653c-428d-8b8a-a7d998cde032:230356</guid><dc:creator>Mehul Harry (Developer Express)</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Check out this three minute video on how to redirect from within an Ajax callback. Normally, to redirect, you would call the &lt;a href="http://msdn.microsoft.com/en-us/library/t9dwyts4.aspx" target="_blank"&gt;HttpResponse.Redirect&lt;/a&gt; method and pass the URL you want to redirect the current page to. But the Redirect method doesn’t work in a callback. &lt;/p&gt;  &lt;p&gt;Here’s where the ASPxHttpHandler Module, with its &lt;a href="http://community.devexpress.com/blogs/aspnet/archive/2008/07/23/video-how-to-handle-an-asp-net-ajax-callback-error.aspx" target="_blank"&gt;multiple uses&lt;/a&gt;, comes to the rescue. With the ASPxHttpHandler Module, you can just check the IsCallback method, then set the &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.httpresponse.redirectlocation.aspx" target="_blank"&gt;HttpResponse.RedirectLocation&lt;/a&gt; property and you’ve got a seamless redirection. Click the image below to learn more. Then drop me a line here and let me know what other approaches you could use to get this redirection.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://tv.devexpress.com/AHHMredirect.movie" target="_blank"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" title="image" border="0" alt="image" src="http://community.devexpress.com/blogs/aspnet/WindowsLiveWriter/2dec7eba0771_E50B/image_3.png" width="400" height="241" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://community.devexpress.com/aggbug.aspx?PostID=230356" width="1" height="1"&gt;</description><category domain="http://community.devexpress.com/blogs/aspnet/archive/tags/screencast/default.aspx">screencast</category><category domain="http://community.devexpress.com/blogs/aspnet/archive/tags/Video/default.aspx">Video</category><category domain="http://community.devexpress.com/blogs/aspnet/archive/tags/How-To/default.aspx">How-To</category><category domain="http://community.devexpress.com/blogs/aspnet/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://community.devexpress.com/blogs/aspnet/archive/tags/ASP.NET+GridView/default.aspx">ASP.NET GridView</category><category domain="http://community.devexpress.com/blogs/aspnet/archive/tags/callback/default.aspx">callback</category></item><item><title>Custom Silverlight Controls: Creating a reusable MessageBox dialog. (Part III)</title><link>http://community.devexpress.com/blogs/theonewith/archive/2008/08/07/custom-silverlight-controls-creating-a-reusable-messagebox-dialog-part-iii.aspx</link><pubDate>Thu, 07 Aug 2008 20:21:00 GMT</pubDate><guid isPermaLink="false">bd716303-653c-428d-8b8a-a7d998cde032:230363</guid><dc:creator>Azret Botash (Developer Express)</dc:creator><slash:comments>5</slash:comments><description>&lt;p&gt;We have created the basics for the MessageBox dialog in &lt;a href="http://community.devexpress.com/blogs/theonewith/archive/2008/08/06/custom-silverlight-controls-creating-a-reusable-messagebox-dialog-part-i.aspx"&gt;Part I&lt;/a&gt; and &lt;a href="http://community.devexpress.com/blogs/theonewith/archive/2008/08/06/custom-silverlight-controls-creating-a-reusable-messagebox-dialog-part-ii-the-popup.aspx"&gt;Part II&lt;/a&gt;. One thing that we realized is that there is no way to block on MessageBox.Show. The cleanest solution to get the dialog result is to make our call API &amp;quot;asynchronous&amp;quot;.&lt;/p&gt;
&lt;p&gt;Something like this:&lt;/p&gt;
&lt;div&gt;
&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;delegate&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; DialogCloseDelegate(&lt;br /&gt;    &lt;span style="color:#0000ff;"&gt;object&lt;/span&gt; sender, &lt;br /&gt;    DialogResult dialogResult);&lt;br /&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;static&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; MessageBox {&lt;br /&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;static&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; Show(&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; title, &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; text, DialogStyle dialogStyle,&lt;br /&gt;        DialogCloseDelegate callback) {&lt;br /&gt;        InternalShow(title, text, dialogStyle, callback);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;...&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; MessageBoxControl : ContentControl {&lt;br /&gt;    DialogCloseDelegate _callback;&lt;br /&gt;&lt;br /&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; MessageBoxControl(Popup owner, DialogCloseDelegate callback)&lt;br /&gt;        : &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;() {&lt;br /&gt;        &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;._callback = callback;&lt;br /&gt;        ...&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; DialogButtonClick(&lt;span style="color:#0000ff;"&gt;object&lt;/span&gt; sender, RoutedEventArgs e) {&lt;br /&gt;        DialogButton button = sender &lt;span style="color:#0000ff;"&gt;as&lt;/span&gt; DialogButton;&lt;br /&gt;        &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (&lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;._owner != &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt; &amp;amp;&amp;amp; button != &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;) {&lt;br /&gt;            &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;._owner.IsOpen = &lt;span style="color:#0000ff;"&gt;false&lt;/span&gt;;&lt;br /&gt;            &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (_callback != &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;) {&lt;br /&gt;                _callback(&lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;, button.DialogResult);&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;We can then use the MessageBox like so:&lt;/p&gt;
&lt;div&gt;
&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#0000ff;"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; Button_Click(&lt;span style="color:#0000ff;"&gt;object&lt;/span&gt; sender, RoutedEventArgs e) {&lt;br /&gt;    MessageBox.Show(&lt;span style="color:#006080;"&gt;&amp;quot;Title&amp;quot;&lt;/span&gt;, &lt;span style="color:#006080;"&gt;&amp;quot;Hello World&amp;quot;&lt;/span&gt;, DialogStyle.OkAndCancel, &lt;br /&gt;        &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; DialogCloseDelegate(OnDialogClose));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; OnDialogClose(&lt;span style="color:#0000ff;"&gt;object&lt;/span&gt; sender, DialogResult dialogResult) {&lt;br /&gt;    MessageBox.Show(&lt;span style="color:#006080;"&gt;&amp;quot;Dialog Result&amp;quot;&lt;/span&gt;, dialogResult.ToString());&lt;br /&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;b&gt;&lt;/b&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;b&gt;What&amp;#39;s Next?&lt;/b&gt;&lt;/div&gt;
&lt;p&gt;Since this is just demo code, a lot of things have been simplified. For example you might want to move the hard-coded &amp;quot;OK&amp;quot; and &amp;quot;Cancel&amp;quot; button contents out into properties. You could make the default template for the message box surface a little prettier, so that it has the look and feel of your application. Hopefully, this article will get you started.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://community.devexpress.com/blogs/theonewith/DevExpressTV.Forms.zip"&gt;Download the Source Code&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Azret&lt;/p&gt;&lt;img src="http://community.devexpress.com/aggbug.aspx?PostID=230363" width="1" height="1"&gt;</description></item><item><title>ANN: DXCore XPO plugin 1.2.0.1</title><link>http://community.devexpress.com/blogs/xpo/archive/2008/08/07/ann-dxcore-xpo-plugin-1-2-0-1.aspx</link><pubDate>Thu, 07 Aug 2008 13:34:05 GMT</pubDate><guid isPermaLink="false">bd716303-653c-428d-8b8a-a7d998cde032:230324</guid><dc:creator>Oliver Sturm (Developer Express)</dc:creator><slash:comments>18</slash:comments><description>&lt;p&gt;Version 1.2.0.1 of the XPO plugin is now available, compiled against DXCore 3.0.8. Please download it here:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://community.devexpress.com/blogs/xpo/CR_XPOFieldSync-1.2.0.1.zip"&gt;CR_XPOFieldSync-1.2.0.1.zip&lt;/a&gt; (20489 bytes)&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;As always, if you&amp;#39;re not familiar with the purpose of the XPO plugin, please read &lt;a href="http://www.devexpress.com/Products/NET/ORM/SimplifiedCriteriaSyntax.xml"&gt;this description of the &amp;quot;Simplified Criteria Syntax&amp;quot; feature&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I have recently mentioned to a few of you, through the Support Center, that I was considering retiring the plugin soon. LINQ has been mentioned several times as the query technology of choice, and I would like to make that point again. The &amp;quot;Simplified Criteria Syntax&amp;quot; feature in XPO was originally introduced as a way to write queries more easily, and specifically with the fact in mind that LINQ was at that time still about two years away from general availability. Now that LINQ is available and well supported in XPO, we do recommend you use it to write queries in code. Since LINQ is a very general-purpose technology, there will be cases where our own criteria system can do things that can&amp;#39;t be represented in a LINQ expression. But for the vast majority of cases, there&amp;#39;s no better way of writing queries in code today.&lt;/p&gt;
&lt;p&gt;Nevertheless I&amp;#39;ve changed my mind about deprecating the XPO plugin. The reason is that I&amp;#39;ve learned how many other things, apart from querying, users do with the plugin and the code it creates. Generally speaking, having a reference to a certain field in a persistent class - which is what the XPO plugin creates - is very useful in a variety of cases that don&amp;#39;t have to do directly with querying, and so cannot be covered by LINQ. So for now, I will keep supporting the XPO plugin as well as time allows.&lt;/p&gt;
&lt;p&gt;For version 1.2.x, I have restructured certain things about the way the plugin works. In prior versions, the plugin was trying to be rather clever about the