in

Platinum Bay

Peace, Love, and...

This Blog

Syndication


.NETicated

April 2007 - Posts

  • Blog Traffic Optimization

    I now have a blog, and I am dutifully writing posts, meaningful post IMHO. But it is a brand new blog, and on a domain not yet in Google. I don't get traffic. For me, my blog is an opportunity to share with the world some things I've learned over the course of my career; to give something back to the world. And my world is .NET technology.

    So how do I share the good news of the One True Way® with the world? More specifically, how do I get eyeballs to my content?

    I've search Google, and I'll share what I find. Whether it works or not, I guess time will tell.

    1. Relevance – You gotta have something meaningful, important or otherwise substantive or you won't get the eyeballs, and you definitely won't get the repeat visitors.

       

    2. Search Engine Optimization – I end up at most blogs by chance, because someone has written about something I want to know, and I find them while searching Google. If you own your site, you can check out Google's Webmaster Tools. Here you can check your crawl status, submit your site for inclusion in their index, add a Google sitemap, view crawl errors and more. Make sure to get listed on the top search engines, Google, Yahoo, Windows Live, Ask.com, etc.

       

      1. A little side note about the new open-format sitemaps. No, not ASP.NET sitemaps. Check out more information about sitemaps at the official site. It's a great way to tell the engines about your basic site layout.

       

    3. Comment on other blogs – I would imagine if you have a blog, then you must have heard about them somewhere and quite possibly read a few. Chances are someone else has read those blogs too. If you have a strong opinion about something someone has blogged, blog back at them. Use trackbacks to link you post to theirs, and you will most likely end up in their comments list, with a link back to your blog. When Google starts to see all these other blogs linking to you, it says "Hey, maybe this is more relevant." Note: Do not engage in comment spam. Don't write meaningless posts just to get traffic. This will backfire anyway; who wants to go to a blog full of meaningless posts?

       

    4. Blogrolls – A blogroll is essentially a list of blogs that the particular blog owner reads. I have roughly 15-20 blogs I read through Outlook 2007, most of which are on my blogroll. Ask your friends, acquaintances, co-workers, etc. if you can be on their blogroll. You must be willing to reciprocate, but this is another way for people to find you, especially if the friend has a popular blog.

       

    5. Check out the social sites: del.icio.us, technorati.com, digg.com, twitter.com, dotnetkicks.com, furl.net, etc. Add links for these and allow people to list your stuff for you.

       

    6. If you're really desperate, you can spend a little money on Google AdWords, or similar advertising.

       

    So whadya think? What's your experience?

    For some more great tips, and satire, check out Seth Godin's top 50 list.

    Posted Apr 28 2007, 12:47 PM by Steve with no comments
    Filed under: ,
  • What’s that connection string?

    How often have you needed a connection string, only to go "Doh! Was it Srvr or Svr for Sybase ODBC?"

    Worry no more. There is a great resource on the web to help you with all your connection string woes.

    Check out ConnectionStrings.com.

  • 701797

    I am still blogging with Word 2007, but tonight it was kicking my butt. I am trying to post a couple things on my mind, and I keep getting Word 2007 errors.

    Figure 1 Word cannot publish this post. - 701797

    Um, What?? I am reminded of a Robin Williams bit; "Can you give me a clue?" So I search Google, "Word cannot publish this post". Come to find out I can hit Ctrl+Shift+I and get an error number in the message; in this case 701797. Ok, cool. This'll tell me what the problem is. So I search again for "Word cannot publish this post" 701797 and I get ONE lousy result. It's a Microsoft KB article telling me that this is due to having more than one category in my post, and my provider only supports one. Wrong and wrong. I only had one category, and my provider supports multiple categories (Community Server). Don't even try searching for 701797; I got all the way out to rural page 9 before I gave up.

    I try creating a new document, and adding the contents again, still no luck. Hmm, maybe my account information got screwed up in Word somehow. I click Manage Accounts, select my account and click Change. I retype my password and click OK.

    Figure 2 Word cannot register your account. - 701796

    After searching Google again, and getting nowhere, I opened up the account settings again, thinking maybe I should delete it and add it again. It was then that the proverbial light bulb went off and I realized that I had changed the setting in Community Server to force the www prefix, but I had not updated my blog post URL in Word from "platinumbay.com" to "www.platinumbay.com". I update the URL, and received:

    Figure 3 Account registration successful. - 701748

    Yay! Hopefully this can help someone.

  • Are you .NETicated?

    Yesterday I acquired a new domain name, www.dotneticated.com, thanks to GoDaddy backordering.  It’s a name that came to me a couple of weeks ago, and I think it makes sense.

    There are several dozen English language words that end in “icated”, some of the more technical ones are:

    • authenticated
    • communicated
    • dedicated
    • duplicated
    • indicated
    • syndicated
    • sophisticated
    • replicated
    • complicated

    Can you guess which one I was thinking of when I got the domain?  Dedicated, and not servers.  I have worked with a lot of my technologies in my career; Java, PHP, Perl, ColdFusion, ASP.old, VB.old, etc.  From time to time I find myself needing to work with MS.old technologies, and that’s ok (slightly), but I could not imagine having to go back and do Java or ColdFusion again.  I am .NETicated!  It’s the best thing to happen to Windows since Aldus PageMaker.  I would like to make the domain some sort of community site for like-minded .NETicated geeks.  The real question is: What do .NETicated geeks need or want that isn’t currently out there?

    For now the domain will point here, to my .NETicated blog at Platinum Bay.  I am certainly open to suggestions, so send them on in.

    Posted Apr 27 2007, 10:41 PM by Steve with no comments
    Filed under: ,
  • Development Environment

    I do all of my development on my laptop. I call it my "mobile development server". Scott Swanson published his Screen Resolution Survey results a couple weeks ago, and I thought I'd get around to chiming in with my thoughts.

    My laptop is running an Intel® Pentium 4 Mobile 3.06 GHz hyper-threaded processor, 2GB DDR memory, a 100 GB 7200 RPM drive, and a 16" 1400 x 1050 screen. I also use a second monitor; 1280x1024 at home and 1024x768 at work.  Let me say right off, this is not enough. Ok, so maybe I can get by with the hard drive, but I absolutely need more memory and processing power and a higher resolution.

    Don't believe me? Here is what I run on my system (usually not ALL at the same time):

    • Windows 2003 Server Enterprise Edition
    • Sql Server 2000 – 7 databases
    • Sql Server 2005 (Express and Enterprise) – 2 and 24 databases respectively
    • Visual Studio 2003 and 2005
    • Microsoft Office 2007
    • Adobe Creative Suite and Flash 8
    • Virtual PC 2005
    • IIS6, DNS, POP3, MSMQ
    • Symantec Antivirus and Windows Defender
    • Desktop Rover
    • Other tools, such as:

    Sometimes, when I am churning away at SQL and checking email and have half a dozen utilities open, my machine seriously crawls.

    So here's what I am looking at buying (if I could afford it):

    • Intel® Core™ 2 Duo Processor T7200 2.0GHz 4MB Cache 667MHz FSB
    • 17" 1920 x 1200 screen.
    • 4GB DDR2 memory
    • Dual 160GB 7,200 RPM drives in RAID 1

    If you have any suggestions on a good laptop, let me know.

    Posted Apr 26 2007, 08:40 PM by Steve with 1 comment(s)
    Filed under:
  • Two-Phase MQ Commit From .NET

    Awhile back, I was building a .NET application which needed to do two-phase commit between MS SQL 2000 and MQSeries (5.3 CSD04 on production). I had the 5.3 CSD05 client installed on my dev box, and the SQL code worked out. But I couldn't figure out how to implement the MQ Series 2-phase commit in .NET.

    Here's what I learned:

    • You cannot do Two-Phase commit with a normal client, regardless of what platform. You can only do XA transactions with either a server application or with the Extended Transactional Client (which is not free).
    • The 5.3 extended transactional client does not support MTS/COM+ transactions.
    • SQL Server can't directly use XS (database) support.
    • SQL server CAN be involved in a DTC transaction in COM+/MTS, and you can only do COM+ DTC coordination if you are coordinating to an MQ server. You need a server installed on the Windows machine and work out a way of routing messages appropriately.

    Since that point I have found several more helpful articles:

    MQ from .NET by Bill O'Brien

    .NET and MQSeries by Dino Chiesa

    MQSeries.NET by Neil Kolban

    MQ Posts by DotNetInterop

    Posted Apr 26 2007, 08:09 PM by Steve with 2 comment(s)
    Filed under: ,
  • Sustainability

    I was in a company meeting today at work, and one of our VPs spoke about her involvement in a corporate sustainability initiative. They are looking out to clients, partners and other resources to find ways to be more green, and not because green is the trend du jour. More and more individuals, communities, companies and governments are realizing the enormous detriment that pollution and waste are having on the environment.

    My dad has always had a sustainability mentality. When my brothers and I were younger, he was always reminding us to not leave doors open, to turn off fans when we leave the room, to not turn the thermostat too high or too low, not leave the refrigerator door open, to only use three sheets of toilet paper, but I digress.

    My dad was thinking this way 10, 15 maybe 20 years ago, when most people thought Global Warming must be a leftover 70s band.

    Today, the younger generations seem to be getting it the best:

    • One hundred thousand Chinese students took part in various activities on March 27 as volunteers to promote environmental protection and ecological conservation throughout the country. - article
    • On April 14, the National Day of Climate Action, more than 1400 cities, towns and colleges across the nation rallied for Congress to enact a law to cut carbon emissions 80% by the year 2050. - link
    • Many well known pop culture icons have taken a stand, including Spinal Tap, Dave Matthews Band, Guster, KORN, Foo Fighters, Sheryl Crow, Al Gore, Salma Hayek, Leonardo DiCaprio, and many, many more.

    Not quite green yet at your workplace? Here are some ideas:

    • Use less paper. I know, roll your eyes. But seriously:
      • Print on both sides of the page.
      • Don't print out things you can read on your screen.
    • Recycle.
    • Use those cool motion-sensitive light switches to turn off the lights when you're not there.
    • Replace existing lightbulbs with low-energy lightbulbs.
    • Take a train instead of a plane when the destination is only a couple hours away.

    And for those of us in the technology sector:

    • Consolidate servers. Datacenters are one of the biggest drains on power.
    • Turn off your computer overnight and on weekends.
    • Use document management software, like SharePoint, to handle forms and documents. Integrate Windows Workflow or BizTalk if you need tracking, approval or other such features.

    For more information, check out Step It Up 2007. Got ideas? Let me know.

  • Searching Google

    Andy talks about getting added to Google in his recent post, something that a lot of people don't really understand.

    The other thing I notice is that people don't really seem to know how to search in Google. For starters, check out the Advanced Search tips page.

    Here are a couple tips I use, result counts are in parenthesis.

    Quotes

    When search for something like Community Server (375 mil), try putting it in quotes, like "Community Server" (1.76 mil).

    .NET

    Search for .NET presents an interesting dilemma as Google strips out the punctuation. Using quotes, ".NET", doesn't help either. What I have found that does help is to include the .NET keyword after what you are search for, such as MasterPages .NET (713 thou).

    Exclusions

    Sometimes I find myself search for development related content that applies to multiple languages. Searching for stringbuilder (2.75 mil) returns results for .NET, Java, PHP and more. If I don't want to narrow my search by including a .NET keyword, I can exclude specific keywords from the results; stringbuilder –java (310 thou).

    Relevance

    When searching, try to imagine what the author of the content you are looking for was thinking. This plays both ways though; when writing online content, try to imagine how the end user will search for your content. For example, my dad owns a ceramic and glassware decoration business. While he may be involved in high-temperature fire-on decals (977), most consumers are not going to use those words to find him. Suppliers and buyers may however. But consumers are going to use terms like "heirloom plate" (9780), or "collectible plates" (113 thou) or dinnerware (7.21 mil).

    Specialty Searches

    Keep in mind that Google has dozens of specialty search pages, some BETA, some live. You can search blogs, books, catalogs, products, news, patents, scholarly papers, videos, US government, Linux, BSD, Mac, Microsoft, and many more.

    One that definitely should be bookmarked is the Google /* Code Search */ Labs BETA. This page allows you to search for public source code, using regular expressions and licensing, language, package and file filters. The Advanced Code Search page makes it a little easier. If I wanted to search for C# code that inherits the template control, I would use \: TemplateControl lang:c# (50).  If you're interested, Travis Laborde wrote a Firefox plugin for Google code search.

    Unfortunately for the Visual Basic developer, all VB languages are lumped together, lang:basic. This can be largely overcome though by using a .NET specific query, such as Inherits Page lang:basic (600) or "Inherits Page" lang:basic (100).

    Hopefully this has given you some insight to find what you are looking for. Now if you'll pardon me, I need to go find an answer to "Windows 2003 Server" hibernate 0xc000009a (30).

    Posted Apr 25 2007, 09:21 AM by Steve with 1 comment(s)
    Filed under:
  • Another VS Code test

    I have done some more testing and this post has been modified to reflect changes: 

    In an earlier post, I blogged about code formatting in Word 2007.  Since then, Andy has posted about using Windows LiveWriter.  So I download LW, and a couple add-ons and give it a whirl.  IMHO, it is not as feature rich as I would like; I was not impressed.  I continued searching and found Peter Gekko's post about CopySourceAsHtml.

    Unfortunately, while close, every line is surrounded by a paragraph element, thereby destroying the layout.  And where there should be an empty line, it is also represented by a paragraph. I'll download the source and see if I can fix this. If so, then I can copy source from Visual Studio, paste it into Word 2007, and forget about it.

    Updated: It seems that I was very mistaken.  The problem does not lie within the CopyCodeAsHtml add-in as I suggested.  I copied text within Visual Studio with CopyCodeAsHtml, pasted it into Expression Web, and was pleased with the results.  I then ran Microsoft Network Monitor 3.0 while posting a message, and it seems that Word 2007 is reformatting the <P Style="Margin: 0px;"> into <P style="BACKGROUND: white">.  I also found that there is a setting, "Wrap Words", which if turned off replaces the <P/> with a <pre/>.  But Word 2007 is also replacing the <pre/> tag with <p style="background:white;">.  So, Word 2007 seems to be the culprit, and I'm still searching for a resolution.

    Posted Apr 25 2007, 08:46 AM by Steve with no comments
    Filed under: ,
  • Top Ten VS Keyboard Shortcuts

    Lisa Feigenbaum from the VB Team at Microsoft just published a list of her top ten Visual Studio keyboard shortcuts. I'm very fond of keyboard shortcuts, both in Visual Studio and in Windows. I couldn't imagine having to use the mouse to copy (Ctrl+C), paste (Ctrl+V), cut (Ctrl+X), switch applications (Alt+Tab), open the task manager (Ctrl+Shift+Esc), minimize all open windows (Win+M) or lock my computer (Win+L).

    And when you spend a good amount of your day in the IDE as I do, the developer in you kicks in and you have to find a more efficient way of doing things.

    So here are my top ten favorites (VB.NET in Visual Studio 2005), in no particular order:

    1. Shift+Tab to switch the active document.
    2. Ctrl+K, Ctrl+C and Ctrl+K, Ctrl+U to comment and uncomment the current line or currently selected lines.
    3. Shift+Del to delete the line of code currently in focus by the cursor.
    4. The classic F5 to start debugging.
    5. Ctrl+Z and Ctrl+Y to undo and redo recent changes.
    6. Ctrl+Shift+Left Arrow and Ctrl+Shift+Right Arrow to select text word by word, instead of character by character.
    7. Ctrl+K, Ctrl+D to format the current document or selection. In VB this auto-formats the casing, indentation, and layout (if enabled).
    8. F10 and F11 to step over and step into, respectively, when debugging.
    9. Ctrl+F and Ctrl+Shift+F to Displays the Find and Replace dialog box for a single-file and multiple-file search, respectively.
    10. I don't have a number ten, offhand. Although from looking through the list, I'll have some new ones shortly.

    Get your free poster today, and take the first step towards enhanced productivity.

    Microsoft Download Center Poster URLs

    Visual Basic 2005 Visual C# 2005 Visual C++ 2005

    Posted Apr 25 2007, 12:50 AM by Steve with no comments
    Filed under:
  • MaintainPostionOnPostback Web Service Error

    I was recently building a website for work, and I thought it would be cool to have the page 'remember' where the scroll position was when a postback was performed. I had set the flag in the web.config file, and forgot about it.

    Awhile later I added a web service to the project, went to debug it in a browser, and got the following message:

    The MaintainScrollPositionOnPostback page directive cannot be set without an htmlform.

    I resolved the issue with the following steps:

    • Remove the web.config maintainScrollPositionOnPostBack flag.
    • Create a base page that inherites from System.Web.UI.Page
    • Set maintainScrollPositionOnPostBack programmatically in the base page.
    • Force all pages to inherit from the base page by setting the pageBaseType attribute for the Pages element in the web.config.

    Base page code:

    Public Class BasePage : Inherits Page
    Private Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
    If Not Page.Request.FilePath.EndsWith("asmx") Then
    MyBase.MaintainScrollPositionOnPostBack = True
    End If
    End Sub
    End
    Class

    Posted Apr 22 2007, 12:24 AM by Steve with no comments
    Filed under:
  • TFS Install

    Awhile ago I found myself trying to install Team Foundation Server. It was before I had a blog, but I thought I would share my thoughts.

    I'm not usually a guy to read the instruction manual. It tends to fall to the wayside in favor of diving right in to whatever I am doing. The same held true for the TFS install. I figured, I've installed dozens of Microsoft products, how hard could this be? And so I fired up the installer. It wasn't long before I started getting error messages, like "Error 32000.The Commandline '"D:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\Bin\Stsadm.exe" ...' returned non-zero value"…. I took the syntax and typed it into the command prompt, and got a more explicit message saying that the STS_Contant_TFS.mdf file already existed. This happened because I had tried to install STS several times, using different methods (the cmd line option using the syntax in the Install CHM is the best), and had left a residual MDF/LDF file in the SQL data directory.

    So I deleted the residual files, dug deeper into the error logs, and fiddled with IIS settings and SharePoint settings and SQL settings. TFS still wouldn't install. I uninstalled SharePoint and reinstalled SharePoint, and deleted databases and recreated databases, and Googled everything.

    I finally hung my head low and accepted that maybe the documentation could have a tidbit of good advice. And browsing through the documentation is where I found my answer, literally. I found that the TFS team had included a setup answer file. So I followed the setup checklist step by step, and using the answer file I was successful with the install, and have been happily teaming away ever since. I was STOKED! Answer files are AWESOME!

    Long story short, RTM.

    Oh, leave out the PID in the answer file for MSDN versions.

    Posted Apr 21 2007, 11:50 PM by Steve with 3 comment(s)
    Filed under: ,
  • Blogging code

    As you may have noticed from some of my blog posts, I like to include code snippets. I also like to paste them directly out of Visual Studio, to maintain the colorization and formatting. But I haven't figured out the 'right' way to do this yet, so some of them look pretty bad. If you have any suggestions, tips or otherwise, please let me know.

    I'll try to clean up the existing posts when I get a chance.

    Posted Apr 21 2007, 11:29 PM by Steve with 1 comment(s)
    Filed under:
  • Blogging from Word 2007

    I am officially blogging from Microsoft Word 2007, and it is pretty cool. I am definitely in favor of using tools I already have. I read a lot of stuff on the web about people not being able to publish pictures, but I seem to be able to do that fine, as well as categorize posts. I save each post as a backup as well in case anything ever happens.

    Blogging from Word is great, much better I think that a WYSIWYG HTML editor. Why?

    • The HTML output is VERY tame, especially considering Word's history with HTML.
    • It is very easy to work with styles, paragraphs and other formatting in a program I am already familiar with.
    • Adding pictures and links are a breeze.
    Posted Apr 21 2007, 10:59 PM by Steve with no comments
    Filed under: ,
  • Windows WOWFlow

    Thursday evening I attended my second Philly .NET User Group meeting at SEI. After shuffling through traffic, I wandered around the SEI campus for several minutes before finding the meeting. Yes, late again, and my car still won't fly. Maybe Lincoln will have a recall?

    Anyway, back to topic, the first session on Windows CardSpace was presented by Peter Laudati. He presented a good overview of CardSpace, formerly known as InfoCard. It seems to me that Microsoft has really taken some time to think this one through; certainly it is no less secure than a credit card in your wallet. Here are several key points from the session:

    • CardSpace runs in a separate client desktop to protect against malicious software.
    • Managed card data is stored at the Information Provider, not on the user's computer.
    • Provides for site identity validation (anti-phishing).
    • CardSpace operates in a 3-way trust environment between the User, the Relying Party and the Identity Provider.
    • Sensitive data is encrypted using the users account and local machine information.
    • Microsoft is collaborating with OpenID.
    • Other companies are involved:
    • Also check out http://www.identityblog.com.

    CardSpace is garnering attention from the technology community, even long-time pundits:

    "Now, with the debut of the InfoCard identity management system, Microsoft is leading a network-wide effort to address the issue. To those of us long skeptical of the technology giant's intentions, the plan seems too good to be true. Yet the solution is not only right, it could be the most important contribution to Internet security since cryptography."

    Lawrence Lessig, Wired Magazine, March 2006.

    The second session was on Windows Workflow, presented by Robert Green of MCW Technologies, and INETA speaker. For those who are not familiar, Windows Workflow Foundation (WF) is the programming model, engine and tools for quickly building workflow enabled applications. WF radically enhances a developer's ability to model and support business processes. Basically Microsoft took a bunch of folks from the BizTalk team, and had them build a workflow framework.

    Let me start out by saying that I had previously loaded the WF bits on my mobile development server (otherwise known as a laptop), and had taken a brief look at it. I didn't spend a whole lot of time, and hadn't really understood it. That said last night was an eye opener. Windows workflow is extremely powerful, robust, and easy to use, sort of, more on that later. After only a couple slides, we started out with a simple sequential workflow, yes I was coding along.

    There are two types of workflows within WF, Sequential and State Machine. Sequential workflows run from beginning to end, in order. State machine workflows can be in any state, and can move to any other state, depending on the defined rules. In the demo, we built a simple "hello workflow world" workflow. Then Robert demonstrated an order processing system using a state machine workflow.

    I was amazed at the power baked into WF. It is very robust and looks solid. It does feel like a free version 1 add-in, however. Hopefully "Orcas" will improve on that. It can also be very time consuming to build workflows. Good design and good understanding of the process(es) to be modeled are important.

    Robert recommended "Pro WF – Windows Workflow in .Net 3.0", published by APress.

  • Xml Schemas – Part 2

    As I posted previously, I have issues. For the purpose of this discussion we'll limit it to my issues relate to working with Xml Schemas.

    I have found more fodder for my discussion. Anything pre-version 2.0 in OFX was laid out in DTDs, not XSDs. For XSDs, .NET has the System.Xml.Schema namespace. There does not seem to be any way of parsing a DTD in .NET. So I have to convert the DTD to an XSD. I open up XMLSpy, load the DTD, and go to "DTD/Schema > Convert DTD/Schema…". Unfortunately, XMLSpy does not like the DTD, "DTD Document expected." So I go to the W3C validator, and it doesn't like it either; root elements and such.

    I find out that the DTD's are not XML DTDs, but SGML DTDs. Apparently nobody supports SGML DTD's, not Visual Studio, not XMLSpy, not Stylus Studio. So I convert them to XML format, and then to XSD's using XMLSpy. But they are still not correct, at least compared to the 2.x OFX schemas.

    So maybe I was a bit hasty taking the schema providers off the hook in my previous post. If the schema isn't to spec, how can anything use it? The OFX specifications were created by Intuit, Microsoft and CheckFree. You would think with Microsoft's hand in it, the schemas would be compatible with their development tools, but I am not above admitting that may just be an uninformed assumption on my part.

    So the underlying question remains, who's responsible for the lack of interoperability between published schemas and the development tools?

    Posted Apr 19 2007, 03:38 AM by Steve with no comments
    Filed under: , , ,
  • Xml Schemas

    Ok, this is getting really frustrating. I frequently find myself needing to implement Xml Schemas within solutions I am building. I spent years working with ASP.old and VB.old, so I really like the whole notion of "Strongly-Typed", and I therefore want to generate code behind an XSD.

    The first attempt for most people is to use XSD.exe, or MSDataSetGenerator in Visual Studio (which calls XSD.exe under the covers) to generate a dataset or classes from the XSD. Unfortunately, the functionality within XSD.exe is limited to what can be described in a database structure. Trying to work with more complex XSDs lead to dreaded error messages, like "The same table (row) cannot be the child table in two nested relations."

    The next attempt is to search the web, thereby finding references to tools such as CodeXS. While these are great tools, they are not without their drawbacks either.

    Take for example the following snippet:

    <xsd:choice>
        <
    xsd:sequence>
            <
    xsd:element name="USERID" type="ofx:IdType" />
            <
    xsd:element name="USERPASS" type="ofx:PasswordType" />
        </
    xsd:sequence>
        <
    xsd:element name="USERKEY" type="ofx:UserKeyType" />

    </
    xsd:choice>

    CodeXS generates this as:

    <System.Xml.Serialization.XmlElementAttribute("USERID", GetType(String), Form:=System.Xml.Schema.XmlSchemaForm.Unqualified), _
    System.Xml.Serialization.XmlElementAttribute("USERKEY", GetType(String), Form:=System.Xml.Schema.XmlSchemaForm.Unqualified), _
    System.Xml.Serialization.XmlElementAttribute("USERPASS", GetType(String), Form:=System.Xml.Schema.XmlSchemaForm.Unqualified),_
    System.Xml.Serialization.XmlChoiceIdentifierAttribute("_ItemsElementName")> _
    Public Property _Items() As String()
        Get
            Return
    StringCollection.ToArray(Me.__Items)
        End Get
        Set
            Me
    .__Items = StringCollection.FromArray(value)
        End Set
    End
    Property

    <System.Xml.Serialization.XmlIgnoreAttribute()> _
    Public Property Items() As StringCollection
        Get
            If
    (Me.__Items Is Nothing) Then
                Me
    .__Items = New StringCollection
            End If
            Return
    Me.__Items
        End Get
        Set
            Me
    .__Items = value
        End Set
    End Property

    While all the items are there, they are not exactly strongly typed. Upon digging further into the schema, and how it was generated, it appears that the generators have issues with elements using restricted SimpleTypes. I could certainly change the code to include each item as a property, but that defeats the purpose of "auto-generated".

    Further, there is no support for the choice element, which defines that the message can include the USERID and USERPASS elements OR the USERKEY element.

    This leads me to my final question; whose fault is it? Are the schema suppliers wrong? I don't think so, all of the schemas I have had problems with DO validate against the Xml Schema specification. So that leaves the developer tools. I have yet to find one that works perfectly. Mainly, I have used Visual Studio, Altova XMLSpy and CodeXS. All of which are excellent tools, but none of which were completely accurate.

    For the record, here are the schemas and product version I refer to above:

    Schemas:

    • OFX (Open Financial eXchange)
    • BPEL (Business Process Execution Language

    Tools:

    • CodeXS Version 0.57 Beta
    • Visual Studio 2005 SP1
    • Altova XMLSpy 2006 rel. 3
    Posted Apr 19 2007, 06:26 AM by Steve with 2 comment(s)
    Filed under: , ,
  • Implicitly Enterprise

    I work for a large financial software company. If I've learned one thing, it's that large companies with the audit and regulatory requirements (like Sarbanes-Oxley and Gramm-Leach-Bliley) of a financial services company are cautious and slow to change; conservative if you will. Among the IT managers and upper management of these companies, there is hesitancy towards changing technologies or embracing new ones. The frustration for me is that I believe such technologies would result in cost savings, quicker time to market, less headaches, or all of the above. But I also understand that when a company already has many millions of lines of source code that work and have been in production for quite some time, why "fix" it? It is a risk.

    One of the key factors to overcoming this dilemma is to reduce the footprint of the future code. And one major way to reduce the footprint is through the utilization of implicit functionality. For ASP.NET, there are a great number of implicit features that can be utilized in enterprise web applications, such as ASP.NET security, schema serialization, health monitoring, data binding, navigation, caching, resource management and localization.

    There is also a middle ground between implicit and explicit that I like to call Partial Implicit. I have utilized Partial Implicit code, as many of us do. In one project, I overrode the default Sitemap provider and implemented my own on top to connect to SQL Server. But I was able to use the underlying implicit model to do so. I didn't have to write every single line of code for authentication or authorization. It was handled for me.

    The more features that can be implemented implicitly or with partial implicity the better. One of the things I have noticed in speaking with technology executives and IT managers is that pointing out the implicit features that require no coding, unit testing or maintenance, and that are supported by a large, reputable company such as Microsoft always helps to solidify a technology argument.

     

    Notice: The views and opinions expressed in this post are strictly mine. The contents of this post have not been reviewed or approved by anyone else, and may or may not represent the views of my employer, or anyone else for that matter.

  • App_Offline.htm

    About a week ago, I attended my first Philly .NET User Group meeting. I have known about them for awhile, but recently I have wanted to get more involved in the development community. The meeting took place over in Cherry Hill, NJ, and it took me about an hour to get there (I think my car is broken, I keep pulling back on the wheel, but it won't flyJ).

    I got to meet several cool folks over there, including Peter Laudati, our (my) local Microsoft DE, Scott Watersmasysk of Telligent Systems (makers of Community Server), Travis Laborde, and Sam Gentile among others.

    Well, I got there late, and it was standing room only. Travis was giving a lively and humorous presentation about Developer Testing techniques and tools. I would have loved to have heard the whole presentation, but I didn't want to stand the whole time. Travis made a comment that he would post slides and notes from his discussion, and I figured I would pick them up later.

    Next was Scott's talk about ASP.NET tips and tricks. I managed to get a seat (on the floor) right in front, and took notes the whole time. He covered some really great stuff, from caching to trust levels, the web.config configSource attribute to AppPool memory thresholds, from the Repeater control to status codes. But the one that stuck in my mind is one I was already aware of, the AppOffline.htm file.

    For those not aware, adding a file named app_offline.htm to the root of your ASP.NET application will cause all requests to be redirected to that page. You can read more over on Scott Guthrie's blog, but essentially it is a mechanism to enable site updates without providing an unstable user experience. Also, as Scott W. says, it will help prevent the locking .dll issue that is not supposed to happen.

    One major problem with using appoffline.htm, though, is that not only blocks requests from the users, but also from you. If you want to verify that the deployment was successful, you can't. Of course we all should be testing and verifying in a QC/QA environment before we publish to production, but some of us just want to make sure, especially with major changes.

    So this got me thinking as to other mechanisms for what I call "maintenance mode." Here are a couple ideas I came up with:

    Server Farms

    In a server farms/failover/load balanced hosting environment, one machine could be taken offline, updated, tested and moved back online.

    Hooking the ASP.NET Lifecycle

    I'm not sure if this is possible yet, stay tuned, but it seems to me that it may be possible to override the app_offline functionality, and allow access from administrative address(es). Maybe Microsoft should add this in a future version?

    Custom Code

    In the past I have written code to do this. I would add configuration items to specify when, and what message. I would then check on every request if "maintenance mode" was turned on. All request not originating from an administrative address would go to a maintenance page.

    If you have any other ideas, feel free to let me know.

    One more thing to keep in mind, from Scott G.'s blog:

    One thing I pointed out in the talk that you want to keep an eye on is a feature of IE6 called "Show Friendly Http Errors". This can be configured in the Tools->Internet Options->Advanced tab within IE, and is on by default with IE6. When this is on, and a server returns a non HTTP-200 status code with less than 512 bytes of content, IE will not show the returned HTML and instead substitutes its own generic status code message (which personally I don't think is super friendly <g>).

  • Location Switcher

    I have finally got it, my Location Switcher.

    First, some background. I use my laptop both at work, and at home. At work, I use a static IP and a second monitor @ 1024x768. At home, I use DHCP and a second monitor @ 1280x1024. So I wake up, go do some work, then go to work, change the settings, then go home and have to change them again. It wasn't long before this got REALLY annoying. For small utilities like this, I much prefer to build versus buy. It is fun. I figured there had to be a way to automate this process. It took a lot of digging around, but I finally got it. I now have an icon in the task tray, which has a context menu with the options I need. I originally had a Console app, but this just seemed easier.

    The first menu item, Location, allows me to select a preconfigured location. When I go to work, I select Work, and it sets my static IP, and secondary monitor resolution. When I go home, it sets my network card to DHCP, and adjusts the second monitor. It is almost too easy. The Resolution item allows me to manually set specific resolutions for either the primary or secondary monitor. The Network option is not yet populated. Configure allows me to set up pre-defined configurations, like Work and Home. Finally Exit allows me to shut down the program in case I ever need to free up the minimal resources it is using because I am running low on the 2GB of memory I have installed.

    Most of what I needed to do I found in the following WMI classes:

    • Win32_NetworkAdapter
    • Win32_NetworkAdapterConfiguration
    • MicrosoftDNS_Server

    For the monitors, I had to dig into the Windows API, yuck. I ended up using three methods in the user32.dll library;

    • EnumDisplaySettings
    • ChangeDisplaySettingsEx
    • EnumDisplayDevices

    For the configuration, I defined a schema (probably overkill), and used MSDataSetGenerator to generate a strongly-typed class. This allowed me to load a config from disk.

    <?xml version="1.0" encoding="utf-8"?>
    <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:cfg="http://tempuri.org/config.xsd" targetNamespace="http://tempuri.org/config.xsd" elementFormDefault="qualified">
       
    <element name="config" type="cfg:tConfig" />
       
    <complexType name="tConfig">
           
    <choice maxOccurs="unbounded"> 
               
    <element name="network" type="cfg:tNetwork" maxOccurs="unbounded" /> 
           
    </choice
       
    </complexType
       
    <complexType name="tNetwork"
           
    <sequence
               
    <element name="nameservers" type="cfg:tNameservers" /> 
               
    <element name="adapter" type="cfg:tAdapter" /> 
               
    <element name="routes" type="cfg:tRoutes" nillable="true" maxOccurs="unbounded" /> 
               
    <element name="display" type="cfg:tDisplay" nillable="true" maxOccurs="1" /> 
           
    </sequence
           
    <attribute name="id" type="string" /> 
           
    <attribute name="name" type="string" /> 
       
    </complexType
       
    <complexType name="tAdapter"
           
    <attribute name="type" type="cfg:tNetworkType" use="required" /> 
           
    <attribute name="ipaddress" type="string" use="optional" /> 
           
    <attribute name="subnet" type="string" use="optional" /> 
           
    <attribute name="gateway" type="string" use="optional" /> 
       
    </complexType
       
    <complexType name="tNameservers"
           
    <sequence
               
    <element name="nameserver" type="cfg:tNameserver" nillable="true" maxOccurs="unbounded" /> 
           
    </sequence
       
    </complexType
       
    <complexType name="tNameserver"
           
    <simpleContent
               
    <extension base="string" /> 
           
    </simpleContent
        
    </complexType
       
    <simpleType name="tNetworkType"
           
    <restriction base="string"
               
    <enumeration value="static" /> 
               
    <enumeration value="dynamic" /> 
           
    </restriction
       
    </simpleType
       
    <complexType name="tRoutes"
           
    <sequence
               
    <element name="route" type="string" minOccurs="0" maxOccurs="unbounded" /> 
           
    </sequence
       
    </complexType
       
    <complexType name="tDisplay"
           
    <sequence minOccurs="0" maxOccurs="1"
               
    <element name="h" type="int" minOccurs="0" maxOccurs="1" /> 
               
    <element name="v" type="int" minOccurs="0" maxOccurs="1" /> 
           
    </sequence
           
    <attribute name="enabled" type="boolean" use="required" /> 
       
    </complexType>
    </schema>

    So there it is. If I get any interest, I might publish the source code. There are still features to add. For example, I would love to have it auto-detect the network and automatically switch.

    Posted Apr 19 2007, 01:31 AM by Steve with 2 comment(s)
    Filed under: ,
Powered by Community Server (Commercial Edition), by Telligent Systems
© Platinum Bay | Some Rights Reserved Creative Commons License

Disclaimer: The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion. Feel free to challenge me, disagree with me, or tell me I'm completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever (abusive, profane, rude, or annonymous comments) - so keep it polite, please.