<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.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>/bill's House O Insomnia&lt;img src="http://www.williamgryan.com/images/originalcuckoo.jpg" alt="Bill Ryan" /&gt; : Visual Studio .NET 2005</title><link>http://msmvps.com/blogs/williamryan/archive/tags/Visual+Studio+.NET+2005/default.aspx</link><description>Tags: Visual Studio .NET 2005</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>Pro WCF: Practical Microsoft SOA Implementation</title><link>http://msmvps.com/blogs/williamryan/archive/2007/02/18/pro-wcf-practical-microsoft-soa-implementation.aspx</link><pubDate>Sun, 18 Feb 2007 23:41:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:595155</guid><dc:creator>William</dc:creator><slash:comments>7</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/rsscomments.aspx?PostID=595155</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/commentapi.aspx?PostID=595155</wfw:comment><comments>http://msmvps.com/blogs/williamryan/archive/2007/02/18/pro-wcf-practical-microsoft-soa-implementation.aspx#comments</comments><description>&lt;P&gt;I went on&amp;nbsp; a book binge this week and have had my nose buried in WCF all week.&amp;nbsp; There's a lot of really good stuff out there, but without a doubt, &lt;A href="http://www.amazon.com/Pro-WCF-Practical-Microsoft-Implementation/dp/1590597028/sr=8-1/qid=1171842173/ref=pd_bbs_sr_1/102-7496017-5356110?ie=UTF8&amp;amp;s=books"&gt;Pro WCF: Practical Microsoft SOA Implementation&lt;/A&gt;&amp;nbsp;by &lt;A href="http://www.chrispeiris.com/"&gt;Chris Peiris&lt;/A&gt;&amp;nbsp;is probably my favorite.&lt;/P&gt;
&lt;P&gt;Overall, the book is just over 400 pages but the author says quite a bit in those 400 pages.&amp;nbsp; The coolest part is that they go over just about every topic that the MSDN Documentation is short on.&amp;nbsp; I found that a lot of things that I stumbled my way through were covered there as well.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;I can't find the link, but a while ago, &lt;A href="http://www.brains-n-brawn.com/"&gt;KC&lt;/A&gt; had a post where his server program uploaded&amp;nbsp;itself&amp;nbsp;his web server and ran itself. His comment was something to the effect about "What did the first Blacksmith use".&amp;nbsp; I was always really impressed with that program. And not just b/c &lt;A href="http://www.brains-n-brawn.com/"&gt;of the lower cased one&lt;/A&gt;'s coding skill. The idea itself was really cool.&amp;nbsp; So when&amp;nbsp;&amp;nbsp;&lt;A href="http://msdn2.microsoft.com/en-us/webservices/aa740663.aspx"&gt;WSE 3.0&lt;/A&gt; came out and &lt;A href="http://en.wikipedia.org/wiki/MTOM"&gt;MTOM&lt;/A&gt;&amp;nbsp; was implemented, I tried to bite his style and accomplish the same thing with MTOM. It's an easy port so it didn't take much skill on my part.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Anyway, I've been trying to figure out how to port most of the WSE 3.0 code from&amp;nbsp; my 70-529 book over to WCF. I've been able to do most of it, however it's been frustrating at times.&amp;nbsp; I'm make a lot of typos and copy/paste errors and neither play well with .config files.&amp;nbsp; After wasting about 3 hours trying to get the MTOM port to work, I read through this book and Viola'. I was kinda mad at myself for overcomplicating things that much.&amp;nbsp; So I guess I really like the book in large part b/c I've had quite a few similar experiences with it.&lt;/P&gt;
&lt;P&gt;My favorite chapters are discussed below:&lt;/P&gt;
&lt;P&gt;Chapter 4 - It discusses installation and configuration.&amp;nbsp; This is the single most frustrating area when learning WCF.&amp;nbsp; Writing code instead of using .config files is lame so I try to avoid it. But getting some help in avoiding common mistakes is priceless..&lt;/P&gt;
&lt;P&gt;Chatper 6 discusses managing WCF Services. Not a glamorous subject but being able to monitor and troubleshoot your programs is critical.&amp;nbsp; Moreover, when you're first learning how to do things, it's easy to ignore performance. It's easy to overlook things that can kill performance.&amp;nbsp; After reading this chapter, I am in a lot better shape to find problems&lt;/P&gt;
&lt;P&gt;Chaper 7 discusses security. Obviously a pretty big issue when you're building services.&amp;nbsp; Just for good measure there's some CardSpace stuff at the end which was a nice touch.&lt;/P&gt;
&lt;P&gt;Chapter 9 discusses transactions. For obvious reasons, this is a subject you need to learn well and although I thought I was pretty familiar with them, I learned more than a few things from this chapter.&lt;/P&gt;
&lt;P&gt;-------------------&lt;/P&gt;
&lt;P&gt;All in all, this book was pretty impressive.&amp;nbsp; They do mostly real world stuff and while they certainly talk theory, they stick to stuff that you'll encounter in your day to day development.&amp;nbsp; You can only take so much theory and I've found that the documentation on MSDN is really heavy on theory and not enough implementation.&amp;nbsp; This book will bridge that gap. &lt;A href="http://www.amazon.com/Professional-WCF-Programming-Development-Communication/dp/0470089849/sr=1-1/qid=1171843376/ref=sr_1_1/102-7496017-5356110?ie=UTF8&amp;amp;s=books"&gt;Scott Klein's WCF book&lt;/A&gt;&amp;nbsp;will help quite a bit too but won't be out for another month or two. &lt;/P&gt;
&lt;P&gt;I also picked up &lt;A href="http://www.amazon.com/Microsoft-Windows-Communication-Foundation-Developer/dp/0735623368/sr=1-1/qid=1171843548/ref=sr_1_1/102-7496017-5356110?ie=UTF8&amp;amp;s=books"&gt;John Sharp's Microsoft Windows Communication Foundation &lt;EM&gt;Step by Step&lt;/EM&gt;&lt;/A&gt;.&amp;nbsp; So far, my impressions are quite favorable although I haven't went through it in quite the detail I did with this one.&amp;nbsp; I worked through each of the examples and found them pretty cool.&amp;nbsp; Should have a review of it up shortly.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=595155" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Books/default.aspx">Books</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/.NET+General/default.aspx">.NET General</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Visual+Studio+.NET+2005/default.aspx">Visual Studio .NET 2005</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/WCF/default.aspx">WCF</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/WIndows+Communication+Foundation/default.aspx">WIndows Communication Foundation</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/.NET+3.0+Framework/default.aspx">.NET 3.0 Framework</category></item><item><title>I'll be doing the presentation next Monday</title><link>http://msmvps.com/blogs/williamryan/archive/2007/01/26/i-ll-be-doing-the-presentation-next-monday.aspx</link><pubDate>Fri, 26 Jan 2007 00:39:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:520176</guid><dc:creator>William</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/rsscomments.aspx?PostID=520176</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/commentapi.aspx?PostID=520176</wfw:comment><comments>http://msmvps.com/blogs/williamryan/archive/2007/01/26/i-ll-be-doing-the-presentation-next-monday.aspx#comments</comments><description>&lt;P&gt;If you're going to be in Atlanta next week, &lt;A href="http://www.atlantadotnet.org/"&gt;stop by the .NET User Group Presentation&lt;/A&gt;&amp;nbsp;. &lt;/P&gt;
&lt;P&gt;As you probably know already, I tend toward non mainstream technologies.&amp;nbsp; This presentation is going to be on &lt;A href="http://cardspace.netfx3.com/"&gt;Windows Cardspace&lt;/A&gt;&amp;nbsp;, &lt;A href="http://msdn2.microsoft.com/en-us/netframework/aa663324.aspx"&gt;Windows Communication Foundation&lt;/A&gt; and &lt;A href="http://wpf.netfx3.com/"&gt;Windows Presentation Foundation&lt;/A&gt;.&amp;nbsp; &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;I've been working diligently as a tech reviewer for&amp;nbsp;&amp;nbsp; &lt;A href="http://www.amazon.com/Professional-WCF-Programming-Development-Communication/dp/0470089849/sr=8-1/qid=1169772126/ref=sr_1_1/104-8028824-2026339?ie=UTF8&amp;amp;s=books"&gt;Scott Klein's Professional WCF Programming&lt;/A&gt;&amp;nbsp;so I'm pretty well versed there.&amp;nbsp; I've learned a lot about WCF from Scott so hopefully I can make a good showing there.&lt;/LI&gt;
&lt;LI&gt;My fascination with Cardspace borders on an obsession so I'm quite confident this part should be cool.&lt;/LI&gt;
&lt;LI&gt;I&amp;nbsp; have 0 UI Skills so while I know my way around WPF, well, my game is pretty weak.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;I was a pretty big fan of Remoting, love Web Services and loved WSE (heck, I was one of the 4 people in the world that actually cared about WSE 3.0) so WCF is just - well, da bomb. Huge move forward here.&lt;/P&gt;
&lt;P&gt;As far as Cardspace, I can only hope it's going to get adopted and go mainstream.&amp;nbsp; Self issuing cards are a cool idea and more than anything, will make things more convenient.&amp;nbsp; There's got to be some streamlined distribution of Managed cards, but once that's addressed, it's got to be huge.&amp;nbsp; I'm having some server problems right now, but hopefully they'll be addressed tonight.&amp;nbsp; &lt;A href="http://community.strongcoders.com/blogs/ryan/"&gt;Ryan&lt;/A&gt;&amp;nbsp;and I are putting together some web services and I hope to have Cardspace up and running with one of them.&lt;/P&gt;
&lt;P&gt;Everybody else in the world is blogging about WPF so I don't have much to add there.&amp;nbsp; &lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=520176" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Visual+Studio+.NET+2005/default.aspx">Visual Studio .NET 2005</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Coding+Techniques/default.aspx">Coding Techniques</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Misc+Technology/default.aspx">Misc Technology</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/WPF/default.aspx">WPF</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Cardspace/default.aspx">Cardspace</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/WCF/default.aspx">WCF</category></item><item><title>How to be really annoying with Pocket Outlook</title><link>http://msmvps.com/blogs/williamryan/archive/2007/01/25/how-to-be-really-annoying-with-pocket-outlook.aspx</link><pubDate>Thu, 25 Jan 2007 06:08:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:517762</guid><dc:creator>William</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/rsscomments.aspx?PostID=517762</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/commentapi.aspx?PostID=517762</wfw:comment><comments>http://msmvps.com/blogs/williamryan/archive/2007/01/25/how-to-be-really-annoying-with-pocket-outlook.aspx#comments</comments><description>&lt;P&gt;If you've been following my coding tonight, you can probably tell what I'm up to. If you call me regularly, you probably are already familiar with this little project, aka the CuckooBot.&amp;nbsp; He's up to Version 4.0 and about to be released into the wild. Yes, this one is more functional and useful than the last but also a lot snarkier and more annoying. In fact, he's also a lot smarter. He has a lot better AI and text parsing for one thing, so he can make better decisions about whether or not I can be disturbed and if you are on the 'cool' list, he'll actually do some of your bidding. When I release the final version, I'll provide everyone with the list of commands he'll respond to.&amp;nbsp; But enough about that for now.&amp;nbsp; Part two of this project involves email.&amp;nbsp; You can shoot the CuckooBot an email with a request, like "Please send ClevelandSteamer.jpg" and if you are authorized, he'll send it.&amp;nbsp; The&amp;nbsp; authorization piece is causing me some grief but it's not like I have anything better to be doing in the middle of the night right?&lt;/P&gt;
&lt;P&gt;Ok, so the way to send Email messages is to first create an OutlookSession object. Instantiate it and scope it as necessary.&amp;nbsp; Next, specify an EmailAccount for it.&amp;nbsp; Next create an EmailMessage and at the end, just Send() it.&lt;/P&gt;
&lt;P&gt;Now, I've mentioned many times that things like BCC, CC, Importance and Sensitivity should be outlawed and considered as tantamount to war crimes for they are pure evil. But too many people like those features so I'll have to keep my little quixotic jihad against them going in other ways.&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&lt;CODE&gt;const&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt; Primary = &lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;"Cuckoo1"&lt;/CODE&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;CODE&gt;private&lt;/FONT&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;CODE&gt;{&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#008080 size=2&gt;&lt;CODE&gt;OutlookSession MainSession = new OutlookSession()&lt;/FONT&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;FONT color=#008080 size=2&gt;&lt;CODE&gt;EmailAccount&lt;/FONT&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;FONT color=#008080 size=2&gt;EmailAccount MainAccount = MainSession.EmailAccounts[Primary];&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;CODE&gt;EmailMessage MyMessage = new EmailMessage();&lt;/FONT&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;CODE&gt;//One dorks set this to High.&lt;/CODE&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;CODE&gt;MyMessage.Importance = &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;Importance&lt;/FONT&gt;&lt;FONT size=2&gt;.Normal;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;CODE&gt;//Again, see above.&lt;/CODE&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;CODE&gt;MyMessage.Sensitivity = &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;Sensitivity&lt;/FONT&gt;&lt;FONT size=2&gt;.Normal;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;MyMessage.Subject = &lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;"Cleveland Steamers vs. Pink Socks on Fox - 8:00 PM EDT"&lt;/FONT&gt;&lt;FONT size=2&gt;;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;MyMessage.To = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;Recipient&lt;/FONT&gt;&lt;FONT size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;"Knights of the Cleveland Steamers"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;"911@clevelandsteamers.org"&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;MyMessage.Attachments.Add(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;Attachment&lt;/FONT&gt;&lt;FONT size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;@"\eviction1.jpg"&lt;/FONT&gt;&lt;FONT size=2&gt;));&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;MyMessage.BodyText = &lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;"Cleveland Steamers aren't appropriate for community sites. However I predict they'll win tonight - 9-2"&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;MainAccount.Send(MyMessage);&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;}&lt;/CODE&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=517762" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Compact+Framework/default.aspx">Compact Framework</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Visual+Studio+.NET+2005/default.aspx">Visual Studio .NET 2005</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Coding+Techniques/default.aspx">Coding Techniques</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Mindless+Babbling/default.aspx">Mindless Babbling</category></item><item><title>Password Protection != Encryption on SqlCe</title><link>http://msmvps.com/blogs/williamryan/archive/2007/01/25/password-protection-encryption-on-sqlce.aspx</link><pubDate>Thu, 25 Jan 2007 03:50:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:517605</guid><dc:creator>William</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/rsscomments.aspx?PostID=517605</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/commentapi.aspx?PostID=517605</wfw:comment><comments>http://msmvps.com/blogs/williamryan/archive/2007/01/25/password-protection-encryption-on-sqlce.aspx#comments</comments><description>&lt;P&gt;I know this probably seems pretty obvious, but believe it or not, it's a very common area of confusion.&amp;nbsp; Take a look at the following declaration:&lt;/P&gt;&lt;FONT color=#008080 size=2&gt;
&lt;P&gt;&lt;CODE&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;CODE&gt;ConnectionString = &lt;/CODE&gt;&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt;.Format(&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;@"Data Source=\BlueCuckoo.sdf;password={0}"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;"SomeValue"&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#008080 size=2&gt;&lt;CODE&gt;SqlCeEngine&lt;/FONT&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;CODE&gt;engine.CreateDatabase();&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;If I asked, "Will this database be encrypted?" you should hopefully answer "No" b/c&amp;nbsp;I gave away the answer in the title. However on more than a few occassions, i've seen people&amp;nbsp;assume that it was.&amp;nbsp; If you don't explicitly add Encrypt&amp;nbsp; = True&amp;nbsp;- it isn't going to be encrypted.&amp;nbsp; And just in case you're wondering "Well, what if I want to encrypt the database but not password protect it?" , well, you wouldn't seriously ask me something like that right?&amp;nbsp;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=517605" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Compact+Framework/default.aspx">Compact Framework</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Visual+Studio+.NET+2005/default.aspx">Visual Studio .NET 2005</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Coding+Techniques/default.aspx">Coding Techniques</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Mindless+Babbling/default.aspx">Mindless Babbling</category></item><item><title>SMS Messages with Windows Mobile 5.0</title><link>http://msmvps.com/blogs/williamryan/archive/2007/01/25/sms-messages-with-windows-mobile-5-0.aspx</link><pubDate>Thu, 25 Jan 2007 02:40:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:517555</guid><dc:creator>William</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/rsscomments.aspx?PostID=517555</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/commentapi.aspx?PostID=517555</wfw:comment><comments>http://msmvps.com/blogs/williamryan/archive/2007/01/25/sms-messages-with-windows-mobile-5-0.aspx#comments</comments><description>&lt;P&gt;A while ago, I was playing around creating a bot, a Snarkier version of the &lt;A href="http://blogs.msdn.com/windowsmobile/archive/2006/10/29/the-mobile-secretary-source-code.aspx"&gt;Mobile Secretary Application&lt;/A&gt;&amp;nbsp;.&amp;nbsp; Well, it was late and I got sloppy. So basically, my little app sent out a text message to everyone on one of my company's Outlook distribution lists. I learned a lot that night.&lt;/P&gt;
&lt;P&gt;So you've always been able to send SMS messages with Smartphone, but it's a lot easier now.&amp;nbsp; Sending them isn't a big deal though. The cool thing is intercepting them.&amp;nbsp; To that end, the &lt;A href="http://msdn2.microsoft.com/en-us/library/microsoft.windowsmobile.pocketoutlook.messageinterception.messageinterceptor.aspx"&gt;Message Interceptor&lt;/A&gt;&amp;nbsp;class makes it quite easy:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV&gt;Create a module level variable (or whatever scope you need it).&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&lt;CODE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;private&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;MessageInterceptor&lt;/FONT&gt;&lt;FONT size=2&gt; Interceptor;&lt;/CODE&gt;&lt;/P&gt;&lt;/FONT&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV&gt;Instantiate it in the constructor&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;CODE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Interceptor = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;MessageInterceptor&lt;/FONT&gt;&lt;FONT size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;InterceptionAction&lt;/FONT&gt;&lt;FONT size=2&gt;.NotifyAndDelete, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;false&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;/CODE&gt;&lt;/P&gt;&lt;/FONT&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV&gt;Specify a &lt;A href="http://msdn2.microsoft.com/en-us/library/microsoft.windowsmobile.pocketoutlook.messageinterception.interceptionaction.aspx"&gt;InterceptionAction&lt;/A&gt;&amp;nbsp;property. (Notify or NotifyAndDelete) - those should be self explanatory [See above]&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV&gt;Specify if you want it to use the Form's thread (a must if you want to update the UI) [see above]&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV&gt;Wire up a handler.&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;CODE&gt;Interceptor.MessageReceived +=&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;MessageInterceptorEventHandler&lt;/FONT&gt;&lt;FONT size=2&gt;(Interceptor_MessageReceived);&lt;/CODE&gt;&lt;/P&gt;&lt;/FONT&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV&gt;Cast the e.Message object in the handler as a SmsMessage and use accordingly&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;CODE&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT size=2&gt; Interceptor_MessageReceived(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;object&lt;/FONT&gt;&lt;FONT size=2&gt; sender, &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;MessageInterceptorEventArgs&lt;/FONT&gt;&lt;FONT size=2&gt; e)&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;&amp;nbsp;&amp;nbsp; SmsMessage&lt;/FONT&gt;&lt;FONT size=2&gt; IncomingMessage = (e.Message &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;as&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;SmsMessage&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;String&lt;/FONT&gt;&lt;FONT size=2&gt;[] ImportantStuff = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt;[]{&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;"Dog pooping"&lt;/FONT&gt;&lt;FONT size=2&gt;,&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Vista Launch"&lt;/FONT&gt;&lt;FONT size=2&gt;,&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"Would you care to explain THIS?"&lt;/FONT&gt;&lt;FONT size=2&gt;,&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Vicodin ES"&lt;/FONT&gt;&lt;FONT size=2&gt;,&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Camel Toe"&lt;/FONT&gt;&lt;FONT size=2&gt;,&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"Kim"&lt;/FONT&gt;&lt;FONT size=2&gt;,&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"Mom"&lt;/FONT&gt;&lt;FONT size=2&gt;,&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "EDC"&lt;/FONT&gt;&lt;FONT size=2&gt;};&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;foreach&lt;/FONT&gt;&lt;FONT size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt; s &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;in&lt;/FONT&gt;&lt;FONT size=2&gt; ImportantStuff){&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT size=2&gt;(IncomingMessage.Body.IndexOf(s)&amp;gt; -1){&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;SmsMessage&lt;/FONT&gt;&lt;FONT size=2&gt; OutgoingMessage = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;SmsMessage&lt;/FONT&gt;&lt;FONT size=2&gt;(e.Message.From.Address, &lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;"This is the Cuckoobot, I'm handling Bill's messages, he'll be in touch shortly"&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;OutgoingMessage.Send();&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;//Yes, I know this isn't optimal - it's demo code.&lt;/CODE&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;CODE&gt;}&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;else&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;CODE&gt;{&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;SmsMessage&lt;/FONT&gt;&lt;FONT size=2&gt; OutgoingMessage = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;SmsMessage&lt;/FONT&gt;&lt;FONT size=2&gt;(e.Message.From.Address, &lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;"This is the Cuckoobot. Your message isn't important and will have to wait."&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;/CODE&gt;&lt;/P&gt;&lt;CODE&gt;OutgoingMessage.Send();&lt;BR&gt;}&lt;BR&gt;}&lt;BR&gt;}&lt;BR&gt;&lt;/CODE&gt;&lt;/FONT&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=517555" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Compact+Framework/default.aspx">Compact Framework</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Visual+Studio+.NET+2005/default.aspx">Visual Studio .NET 2005</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Coding+Techniques/default.aspx">Coding Techniques</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Mindless+Babbling/default.aspx">Mindless Babbling</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Misc+Technology/default.aspx">Misc Technology</category></item><item><title>A very slick Smartphone Emulator feature</title><link>http://msmvps.com/blogs/williamryan/archive/2007/01/25/a-very-slick-smartphone-emulator-feature.aspx</link><pubDate>Thu, 25 Jan 2007 01:25:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:517187</guid><dc:creator>William</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/rsscomments.aspx?PostID=517187</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/commentapi.aspx?PostID=517187</wfw:comment><comments>http://msmvps.com/blogs/williamryan/archive/2007/01/25/a-very-slick-smartphone-emulator-feature.aspx#comments</comments><description>&lt;P&gt;I'm finishing up some SmartPhone articles I should have posted soon but figured I could discuss this one very quickly.&amp;nbsp; Any professional application should be thoroughly tested on a physical device that it will be run on. However that's not practical for incremental builds throughout the day.&amp;nbsp; So that's where Emulators fit in right?&amp;nbsp; Anyway, one shortcoming of emulators is, rather was, the inability to duplicate functionality exclusive to the phone. How would you simulate an incoming call or SMS message?&amp;nbsp; Fortunately, that's easily resolved now.&amp;nbsp; Let's say you want to send a SMS message and test it.&amp;nbsp; Just use 425.001.0001 and viola, it will fire a SMS message directly to your emulator.&amp;nbsp; Just to show how easy it is...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&lt;CODE&gt;private&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT size=2&gt; SendSMSMessage(&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt; phoneNumber, &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt; message){&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;SmsMessage&lt;/FONT&gt;&lt;FONT size=2&gt; NewMessage = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;SmsMessage&lt;/FONT&gt;&lt;FONT size=2&gt;(phoneNumber, message);&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;NewMessage.Send();&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;}&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;Then to fire it off... &lt;FONT size=2&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;SendSMSMessage(&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;"14250010001"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;"Behold the greatness of the Blue Cuckoo!"&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;/CODE&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;More coming shortly, I promise!&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=517187" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Compact+Framework/default.aspx">Compact Framework</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Visual+Studio+.NET+2005/default.aspx">Visual Studio .NET 2005</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Coding+Techniques/default.aspx">Coding Techniques</category></item><item><title>Professional Microsoft SmartPhone Programming</title><link>http://msmvps.com/blogs/williamryan/archive/2007/01/23/professional-microsoft-smartphone-programming.aspx</link><pubDate>Tue, 23 Jan 2007 00:59:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:511937</guid><dc:creator>William</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/rsscomments.aspx?PostID=511937</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/commentapi.aspx?PostID=511937</wfw:comment><comments>http://msmvps.com/blogs/williamryan/archive/2007/01/23/professional-microsoft-smartphone-programming.aspx#comments</comments><description>&lt;P&gt;I just got a copy of &lt;A href="http://www.amazon.com/Professional-Microsoft-Smartphone-Programming-Baijian/dp/0471762938/sr=1-1/qid=1169513943/ref=pd_bbs_sr_1/104-8028824-2026339?ie=UTF8&amp;amp;s=books"&gt;Professional Microsoft SmartPhone Programming&lt;/A&gt;&amp;nbsp;and all I can say is NICE!&amp;nbsp; I always worried that the first real SmartPhone book would not go into enough depth to be useful. Not an issue here. Basically, the book is a list of "What would you like to do with Smartphone" and shows you how to do it. &lt;/P&gt;
&lt;P&gt;I need to finish reading the last two chapters before I can fully review it&amp;nbsp;but having read most of it already, this book is just plain good and if you have any interest in Smartphone Programming, it's worth its weight in gold.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=511937" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Compact+Framework/default.aspx">Compact Framework</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Books/default.aspx">Books</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Visual+Studio+.NET+2005/default.aspx">Visual Studio .NET 2005</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Misc+Technology/default.aspx">Misc Technology</category></item><item><title>Musings on the database formerly known as Sql Everywhere</title><link>http://msmvps.com/blogs/williamryan/archive/2006/11/02/Musings-on-the-database-formerly-known-as-Sql-Everywhere.aspx</link><pubDate>Thu, 02 Nov 2006 01:53:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:237552</guid><dc:creator>William</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/rsscomments.aspx?PostID=237552</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/commentapi.aspx?PostID=237552</wfw:comment><comments>http://msmvps.com/blogs/williamryan/archive/2006/11/02/Musings-on-the-database-formerly-known-as-Sql-Everywhere.aspx#comments</comments><description>&lt;p&gt;The IM volume I received today about the &lt;a href="http://blogs.msdn.com/stevelasker/archive/2006/10/31/sql-server-everywhere-gets-yet-another-name.aspx"&gt;Rollback to SqlCE&lt;/a&gt;&amp;nbsp;issue was enough to border on overwhelming.&amp;nbsp; Between PMs and some lazy SOB CRM guy trying to get me to do all his work for him, it was hard focusing on work today. (And seriously, if you are a CRM professional, telling me you don&amp;#39;t know how to do a two table, one field inner join so i have to do it for you, makes you look like a Complete Moron.&amp;nbsp; Try &amp;#39;Bill, I&amp;#39;m really busy, can you do me a favor and write this join for me&amp;#39; next time, at least then my gag reflex won&amp;#39;t kick in).&amp;nbsp; But I digress.&lt;/p&gt;&lt;p&gt;Anyway, I&amp;#39;ve been getting a lot of email about my presentations on Everywhere.&amp;nbsp; I guess I got people thinking about a few assertions I&amp;#39;ve made.&amp;nbsp; In a nutshell, I made the following comments:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;I love ADO.NET and in no way am I disparaging it, but in some scenarios, the disconnected model just doesn&amp;#39;t fit.&amp;nbsp; This has nothing to do with any deficiency in theory or implementation of ADO.NET.&amp;nbsp; A Ferrari is a great vehicle but if you need to tow a heavy boat, it&amp;#39;s not the right vehicle.&lt;/li&gt;&lt;li&gt;The one case where I don&amp;#39;t think the ADO.NET architectue is well suited to handle is single user scenarios where you are *positive* that you&amp;#39;ll only have one user connecting to your database.&lt;/li&gt;&lt;li&gt;Devices like Smartphones and PDAs proabably aren&amp;#39;t going to be targeting multiple users simultaneously and in those cases, where you are resource constrained and pretty much assured of a single user, the database-&amp;gt;dataset model is overly consumptive.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;In case you don&amp;#39;t understand why, let me explain.&amp;nbsp; What does using a disconnected model bring to the table?&amp;nbsp; Essentially it brings tremendous scability and at least as far as the server is concerned, the possiblity of improved performance.&amp;nbsp; It is a Just In Time data access strategy that can greatly minimize locking and bottlenecks.&amp;nbsp; Like anything, it needs to be used wisely but the fact you don&amp;#39;t have to keep a persisent connection to the db is huge.&amp;nbsp; This benefit isn&amp;#39;t free.&amp;nbsp; In exchange for it you have to pay a price in RAM b/c you&amp;#39;re using cached copy of the data.&amp;nbsp; In most cases, this tradeoff is well worth it.&amp;nbsp; In some though, it makes very little sense.&amp;nbsp; Think of a Smartphone.&amp;nbsp; I have one user.&amp;nbsp; Only one person needs to be hitting the db at once.&amp;nbsp; I have the data persisted to disk and I have limited RAM.&amp;nbsp; What benefit does sticking a dataset in between my UI and the backend db bring?&amp;nbsp; None.&lt;/p&gt;&lt;p&gt;That&amp;#39;s where the beauty of using SqlCE/SqlMobile/SqlEverywhere/SqlCE comes in.&amp;nbsp; You can use the SqlCeResultset which is scrollable and updateable, and you can cut out the layer in the middle.&amp;nbsp; Your logic is trimmed down b/c updates/inserts/deletes require no work on your part provided the table you&amp;#39;re hitting is keyed.&lt;/p&gt;&lt;p&gt;But that has a problem.&amp;nbsp; What if the data needs synchronized with a db server?&amp;nbsp; Well, you can roll your own logic.&amp;nbsp; Or you can use a familiar, well documented, well tested and peer reviewed mechanism.&amp;nbsp; Unless you&amp;#39;re getting paid by the hour and you have no compunction about robbing from your clients, use the latter.&lt;/p&gt;&lt;p&gt;So in short, on a SmartPhone or PDA, SqlCe/SqlMobile/SqlEverywhere/SqlCe is a seemlingly perfect solution for data access. Now that you can run it on a desktop, the same holds for single user scenarios there.&amp;nbsp; And using a SqlCeResultset&amp;nbsp;is *not* a replacement for ADO.NET.&amp;nbsp; It&amp;#39;s still ADO.NET in every sense of the word, it&amp;#39;s just a evolution of one aspect of it. And a darned good on for single user scenarios.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=237552" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Compact+Framework/default.aspx">Compact Framework</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Data+Access/default.aspx">Data Access</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Visual+Studio+.NET+2005/default.aspx">Visual Studio .NET 2005</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Coding+Techniques/default.aspx">Coding Techniques</category></item><item><title>Transferring data around with ADO.NET 2.0 - SqlBulkCopy</title><link>http://msmvps.com/blogs/williamryan/archive/2006/08/26/109836.aspx</link><pubDate>Sat, 26 Aug 2006 16:03:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:109836</guid><dc:creator>William</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/rsscomments.aspx?PostID=109836</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/commentapi.aspx?PostID=109836</wfw:comment><comments>http://msmvps.com/blogs/williamryan/archive/2006/08/26/109836.aspx#comments</comments><description>I'm working at a client on a data migration and found some results that were surprising. I expected there to be a difference but not one quite this large... Synopsis of Problem: Right now I'm working on a rather complex migration from a bunch of disparate...(&lt;a href="http://msmvps.com/blogs/williamryan/archive/2006/08/26/109836.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://msmvps.com/aggbug.aspx?PostID=109836" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Data+Access/default.aspx">Data Access</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Visual+Studio+.NET+2005/default.aspx">Visual Studio .NET 2005</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Coding+Techniques/default.aspx">Coding Techniques</category></item><item><title>Could not complete the operation due to error 80041001</title><link>http://msmvps.com/blogs/williamryan/archive/2006/07/06/103983.aspx</link><pubDate>Thu, 06 Jul 2006 05:34:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:103983</guid><dc:creator>William</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/rsscomments.aspx?PostID=103983</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/commentapi.aspx?PostID=103983</wfw:comment><comments>http://msmvps.com/blogs/williamryan/archive/2006/07/06/103983.aspx#comments</comments><description>Just as an FYI about this... If you are using the documentation for WSE 3.0 and trying opening it after installing IE7 - you get an error with the following message "Could not complete the operation due to error 80041001" This is a total drag b/c all...(&lt;a href="http://msmvps.com/blogs/williamryan/archive/2006/07/06/103983.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://msmvps.com/aggbug.aspx?PostID=103983" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Web+Services+_2F00_+WSE/default.aspx">Web Services / WSE</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/.NET+General/default.aspx">.NET General</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Visual+Studio+.NET+2005/default.aspx">Visual Studio .NET 2005</category></item><item><title>Do you have any ideas about preparation for 70-529?</title><link>http://msmvps.com/blogs/williamryan/archive/2006/06/28/102989.aspx</link><pubDate>Wed, 28 Jun 2006 02:30:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:102989</guid><dc:creator>William</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/rsscomments.aspx?PostID=102989</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/commentapi.aspx?PostID=102989</wfw:comment><comments>http://msmvps.com/blogs/williamryan/archive/2006/06/28/102989.aspx#comments</comments><description>As you may know, I'm coauthoring http://www.microsoft.com/learning/exams/70-529.asp . In particular, I'm covering the following objectives: Create and configure an XML Web service method. Create a public method. Attach the WebMethodAttribute attribute...(&lt;a href="http://msmvps.com/blogs/williamryan/archive/2006/06/28/102989.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://msmvps.com/aggbug.aspx?PostID=102989" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Web+Services+_2F00_+WSE/default.aspx">Web Services / WSE</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Books/default.aspx">Books</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/.NET+Basics/default.aspx">.NET Basics</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/.NET+General/default.aspx">.NET General</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Visual+Studio+.NET+2005/default.aspx">Visual Studio .NET 2005</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Coding+Techniques/default.aspx">Coding Techniques</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Misc+Technology/default.aspx">Misc Technology</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Certification/default.aspx">Certification</category></item><item><title>Using the SqlConnectionStringBuilder to guard against Connection String Injection Attacks</title><link>http://msmvps.com/blogs/williamryan/archive/2006/01/15/81115.aspx</link><pubDate>Sun, 15 Jan 2006 14:40:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:81115</guid><dc:creator>William</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/rsscomments.aspx?PostID=81115</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/commentapi.aspx?PostID=81115</wfw:comment><comments>http://msmvps.com/blogs/williamryan/archive/2006/01/15/81115.aspx#comments</comments><description>&lt;P&gt;&lt;FONT face=Verdana size=2&gt;One new object in the ADO.NET 2.0 Library worth taking a look at is the &lt;A href="http://blogs.msdn.com/DataAccess/archive/2005/03/30/403926.aspx"&gt;SqlConnectionStringBuilder&lt;/A&gt;&amp;nbsp;.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Considering how late it is in the game, you are probably&amp;nbsp;aware of the dangers of &lt;A href="http://search.msn.com/results.aspx?q=Sql+injection+Attacks&amp;amp;FORM=QBHP"&gt;Sql Injection Attacks&lt;/A&gt;&amp;nbsp;.&amp;nbsp;&amp;nbsp;One&amp;nbsp;the off chance you aren't,&amp;nbsp;let me throw in my two cents and recommend that you familiarize yourself with them ASAP.&amp;nbsp; Anyway, injection attacks are possible when you use dynamic string concatenation to build your Sql Statements and you don't paramaterize them or escape all possible malicious input.&amp;nbsp; This presents a small problem b/c you need to employ user input in your applications in many cases, but every time you accept user input, you increase the surface are of an attack.&amp;nbsp; And regrettably, there are too many cases where people 'solve' this problem by employing a solution worse than the problem itself.&amp;nbsp; For instance, I've seen some people hell bent of using Dynamic Sql (and not parameters) solve the injection problem by disallowing all special characters.&amp;nbsp; While this does address the problem directly, it has the unintended consequence of forcing the users to use less strong passwords.&amp;nbsp; And most of the cases that I've seen where people implemented this rule, they increased the lenght of possible passwords to offset this vulnerability. Well, that 'solution' opens you up to other sorts of mischief.&amp;nbsp; After all, if you only allow people ten characters for their password, there's only so much malicious sql they can push off on you.&amp;nbsp; But assuming you don't increase the length of the password, you just pretty much hamstrung the user into have to adopt a weaker password scheme.&amp;nbsp; I've bitched about &lt;a href="http://msmvps.com/blogs/williamryan/archive/2004/03/20/4063.aspx"&gt;this alot in the past&lt;/A&gt;&amp;nbsp;and it's not really the focus of this article so I'll cut it short here.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;So what about Connection String injection attacks?&amp;nbsp; Well, yes, it's something you should guard against.&amp;nbsp; When I was first learning .NET, I created this application that stored User Name/Password combinations in a Database, both of which were encrypted.&amp;nbsp; This was&amp;nbsp; a particularly sensitive application and I was still pretty naive about security.&amp;nbsp; So I came up with a solution that entailed a good bit of extra maintenance but which I believed would give me extra security.&amp;nbsp; What I did was create a Sql Server login for every user.&amp;nbsp; So to even create the connection in the first place, I used their username/password combo to open the connection and then I ran an query that would check the authentication table, decrypt the username and password and pass back an output parameter indicating if they authenticated correctly or not.&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;This was not just a bad idea, it was terrible.&amp;nbsp; For one thing, it was a nightmare to administer.&amp;nbsp; Every time we added a user, I'd have to create a new Sql Server account and had to use a utility I wrote to hash the password.&amp;nbsp; Other than being a pain in the neck, this made it impossible to add a new user for use with many of our applications without having to use my utlity (which people were unable to find on multiple occassions).&amp;nbsp; Another problem was with connection pooling.&amp;nbsp; If you have different connection strings for every user, it can have a serious adverse affect with &lt;A href="http://www.sql-server-performance.com/sk_connection_pooling_myths.asp"&gt;Connection Pooling&lt;/A&gt;&amp;nbsp;. Anyway, I thought all of this was worth it all in all b/c of the extra security benefit.&amp;nbsp; Then &lt;A href="http://blogs.msdn.com/angelsb/"&gt;Angel Saenz-Badillos&lt;/A&gt;&amp;nbsp;saw a post I had&amp;nbsp;that described&amp;nbsp;what I was doing and he set me straight.&amp;nbsp; You see, my whole concept was based on the fact that I didn't realize you could hack the connection string (don't ask me why, it should have been clear to me from the get go).&amp;nbsp; But all it takes for someone to have caused some mischief for me was to add Max Pool Size 100000000; Min Pool Size 100000000 to the password field. Sure, we are used to limiting the field size in many cases for fields that we accept input from but it's not unheard of for someone to leave it the default size.&amp;nbsp; Another trick that they could do is add "; Trusted_Connection = true".&amp;nbsp; This will cause a 'last one wins' scenario so in the case of my app, the machine account would be used instead of the assigned user account and if it had more privileges than the user account did, well, there was just an escalation of privilege.&amp;nbsp; Combined with a Sql Injection attack, this could cause some problems.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;The good news is that in order to do much damage, the attacker would need to know the username and password or the machine itself would have to have sufficient permissions with the Sql Server to allow something troublesome to happen.&amp;nbsp; But relying primarily on 'luck' to not get hacked is kind of a lame strategy.&amp;nbsp; The other thing about Connection String Injection attacks is that if everything else is handled correctly (no unparamaterized queries allowed) then the attack surface is pretty much limited to non-permanent items or things that are just annoyances (although depending on the nature of your data, these annoyances could get quite serious very quickly).&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;So how do you address this issue?&amp;nbsp; Fortunately the good folks on the &lt;A href="http://blogs.msdn.com/dataaccess/default.aspx"&gt;DataWorks Team&lt;/A&gt;&amp;nbsp;gave use the SqlConnectionStringBuilder.&amp;nbsp; Basically, it handles the escaping issues for you and has the side benefit of being easier to use.&amp;nbsp; For one thing you can use it just like you would you old connection strings if you're dead set on not changing your ways:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&lt;FONT color=#7fffd4&gt;&lt;STRONG&gt;SqlConnectionStringBuilder&lt;/STRONG&gt;&lt;/FONT&gt; OldSchool = &lt;FONT color=#0000ff&gt;new&lt;/FONT&gt; &lt;FONT color=#7fffd4&gt;&lt;STRONG&gt;SqlConnectionStringBuilder&lt;/STRONG&gt;&lt;/FONT&gt;(&lt;FONT color=#a52a2a&gt;"Data Source=Clock1;Initial Catalog=Pr0nStarz;User Id=CuckooBurd;Password=++dfjk33nmjKLLa;"&lt;/FONT&gt;);&lt;BR&gt;&lt;FONT color=#7fffd4&gt;&lt;STRONG&gt;SqlConnection&lt;/STRONG&gt;&lt;/FONT&gt; cn = &lt;FONT color=#0000ff&gt;new&lt;/FONT&gt; &lt;FONT color=#7fffd4&gt;&lt;STRONG&gt;SqlConnection&lt;/STRONG&gt;&lt;/FONT&gt;(OldSchool.ToString());&lt;BR&gt;&lt;FONT face=Verdana size=2&gt;Now you can use the SqlConnectionStringBuilder just like this, it's as easy as pie:&lt;/FONT&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&lt;/CODE&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&lt;FONT color=#0000ff&gt;private void&lt;/FONT&gt; DemoConnectionStringBuilder()&lt;BR&gt;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp; &lt;FONT color=#7fffd4&gt;&lt;STRONG&gt;SqlConnectionStringBuilder&lt;/STRONG&gt;&lt;/FONT&gt; ConnectionBuilder = &lt;FONT color=#0000ff&gt;new&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color=#7fffd4&gt;SqlConnectionStringBuilder&lt;/FONT&gt;&lt;/STRONG&gt;();&lt;BR&gt;&amp;nbsp;&amp;nbsp; ConnectionBuilder.DataSource = &lt;STRONG&gt;&lt;FONT color=#7fffd4&gt;SecurityUtil&lt;/FONT&gt;&lt;/STRONG&gt;.DecryptText&lt;FONT color=#a52a2a&gt;(@"#*a0-%%% ^889333"&lt;/FONT&gt;,&amp;nbsp;&amp;nbsp;&lt;FONT color=#7fffd4&gt;&lt;STRONG&gt;SecurityUtil&lt;/STRONG&gt;&lt;/FONT&gt;.CryptoProviders.TripleDES); &lt;BR&gt;&amp;nbsp; ConnectionBuilder.InitialCatalog = &lt;FONT color=#7fffd4&gt;&lt;STRONG&gt;SecurityUtil&lt;/STRONG&gt;&lt;/FONT&gt;.DecryptText(&lt;FONT color=#a52a2a&gt;"pR9s4%~`"&lt;/FONT&gt;);&lt;BR&gt;&amp;nbsp; &lt;FONT color=#008000&gt;//Here you can specify either&lt;/FONT&gt;&lt;BR&gt;&amp;nbsp; ConnectionBuilder.IntegratedSecurity = &lt;FONT color=#0000ff&gt;true&lt;/FONT&gt;;&lt;BR&gt;&amp;nbsp; &lt;FONT color=#008000&gt;//ConnectionBuilder.UserID = SecurityUtil.DecryptText("pR9s4%~`") ;&lt;BR&gt;&amp;nbsp; //ConnectionBuilder.Password =&amp;nbsp; SecurityUtil.DecryptText("!Cuck00zR~!e", SecurityUtil.CryptoProviders.TripleDES);&lt;/FONT&gt;&lt;BR&gt;&amp;nbsp; &lt;FONT color=#0000ff&gt;using&lt;/FONT&gt;(&lt;FONT color=#7fffd4&gt;SqlConnection&lt;/FONT&gt; MainConnection = &lt;FONT color=#0000ff&gt;new&lt;/FONT&gt; &lt;FONT color=#7fffd4&gt;SqlConnection&lt;/FONT&gt;(ConnectionBuilder.ToString())){&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MainConnection.Open();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color=#008000&gt;//Do your thing&lt;/FONT&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MainConnection.Close();&lt;BR&gt;&amp;nbsp;}&lt;BR&gt;}&lt;/CODE&gt;&lt;BR&gt;&lt;FONT face=Verdana size=2&gt;In the above example, I went with Integrated Security and commented out the username and password, but you can switch these back and forth.&amp;nbsp; All of the properties like Max Pool Size, Pooling, Workstation ID, PacketSize, everything you normally manipulate is there and since you have intellisense support, you have cues as to just about everything you may need.&amp;nbsp; Moreoever, if you want to be really safe, you can also create another wrapper class that exposes some of there properties but limits Max Pool Size or Min Pool Size in the accessors.&amp;nbsp; For instance it could check one vs the other and if you aren't comfortable with the numbers, you can throw an exception, change them to something you like, or do whatever you see fit. Same goes for the UserName/Password and Trusted Connection. Although it will escape any attempt to try to put Trusted_Connection = true as a value, you can use your class to manually ensure that only one or the other is chosen.&amp;nbsp; Right out of the Box the SqlConnectionStringBuilder is very powerful and can give you most of the functionality you'd ever want but there may be a case or two where you need everything to be even more granular - in which case you can easily implement such a scenario.&amp;nbsp; Sure, as far as features go, this is more evolutionary than revolutionary, but it's a nice touch.&amp;nbsp; If nothing else it will keep you from having to flip over to &lt;A href="http://www.connectionstrings.com/"&gt;http://www.connectionstrings.com&lt;/A&gt; over and over when you are building new applications&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;-----&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;As an aside, I've listed the two primary targets for a Connection String injection attack but I'm not convniced that there aren't any other ones. If you can think of any other mischief you can cause via the connection string, be a pal and shoot me your idea - I'll include it as an addendum to this post and give you the credit.&lt;/FONT&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=81115" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Data+Access/default.aspx">Data Access</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/.NET+General/default.aspx">.NET General</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Visual+Studio+.NET+2005/default.aspx">Visual Studio .NET 2005</category></item><item><title>Pimping RowState in ADO.NET 2.0</title><link>http://msmvps.com/blogs/williamryan/archive/2006/01/14/81063.aspx</link><pubDate>Sat, 14 Jan 2006 23:20:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:81063</guid><dc:creator>William</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/rsscomments.aspx?PostID=81063</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/commentapi.aspx?PostID=81063</wfw:comment><comments>http://msmvps.com/blogs/williamryan/archive/2006/01/14/81063.aspx#comments</comments><description>&lt;P&gt;&lt;FONT face=Verdana size=2&gt;There are two new methods for the &lt;A href="http://msdn2.microsoft.com/en-us/library/7f2d84ta(en-US,VS.80).aspx"&gt;DataRow&lt;/A&gt;&amp;nbsp;object in ADO.NET 2.0 that haven't gotten much coverage but can be quite useful.&amp;nbsp;The two methods are &lt;A href="http://msdn2.microsoft.com/en-us/library/system.data.datarow.setadded.aspx"&gt;SetAdded&lt;/A&gt;&amp;nbsp;and &amp;nbsp;&lt;A href="http://msdn2.microsoft.com/en-us/library/6ds359ak(en-US,VS.80).aspx"&gt;SetModified&lt;/A&gt;&amp;nbsp;.&amp;nbsp; I consider myself to be an ADO.NET afficionado and until last week, I wasn't aware of these (yes, lame on my part).&amp;nbsp; I was eating lunch with a few guys from the ADO.NET team and I mentioned to &lt;A href="http://www.microsoft.com/MSPress/books/authors/auth5354.asp"&gt;David Sceppa&lt;/A&gt;&amp;nbsp;that it would be really cool if there was a way to manually set &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatadatarowclassrowstatetopic.asp"&gt;RowState&lt;/A&gt;.&amp;nbsp;I've had the need to manually manipulate &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatadatarowclassrowstatetopic.asp"&gt;RowState&lt;/A&gt;&amp;nbsp;in the past and each solution was pretty lame.&amp;nbsp; Basically I'd go to the row, then change the value to itself.&amp;nbsp; This was really awkward b/c well, it looks screwy.&amp;nbsp; The thought of setting a variable to itself shouldn't sit well with anyone b/c with very limited exceptions, it's a totally useless operation.&amp;nbsp; But when it comes to Rowstate, it was sometimes necessary.&amp;nbsp; For the uninitiated, a &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatacommondataadapterclasstopic.asp"&gt;DataAdapter object&lt;/A&gt;&amp;nbsp;depends on &amp;nbsp;Rowstate exclusively to &lt;a href="http://msmvps.com/blogs/williamryan/archive/2005/01/21/33520.aspx"&gt;determine what action(s) it's going to take during a call to Update.&lt;/A&gt;&amp;nbsp;So let's say that you wanted to take the data from one table and move it to another one.&amp;nbsp; The 'right' way to do this is using DTS or &lt;a href="http://msmvps.com/blogs/williamryan/archive/2004/07/10/9890.aspx"&gt;SqlBulkCopy&lt;/A&gt;&amp;nbsp;(and yes, somehow I got ranked #1 on google for SqlBulkCopy ;-)&amp;nbsp; ) but that's another story.&amp;nbsp; Anyway, one of the other ways which was kind of a kluge albeit a pretty good one, was to set the &lt;A href="http://www.knowdotnet.com/articles/datasetmerge.html"&gt;AcceptChangesDuringFill&lt;/A&gt;&amp;nbsp;property of your adapter to false.&amp;nbsp; This would in effect fill your &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatadatatableclasstopic.asp"&gt;DataTable&lt;/A&gt;&amp;nbsp;with rows that had a &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatadatarowstateclasstopic.asp"&gt;DataRowState&lt;/A&gt;&lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatadatarowclassrowstatetopic.asp"&gt;&lt;/A&gt;&amp;nbsp;of Added.&amp;nbsp; You could then configure a second adapter, pointing to your destination table and simply call the Update method on it, passing in your just filled DataTable.&amp;nbsp;Just as a note of caution - it's not typically advisable to use disconnected architecture to move data within the same database, after all&amp;nbsp; you are using network bandwidth and resources that aren't necessary, but that's another issue.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Well, if you want to do manipulations like these, you were very limited in the past.&amp;nbsp; That is no longer the case.&amp;nbsp; With the new SetAdded and SetModified methods, you can change the DataRowState of a given row to either added or modified without having to resort to setting a value back to itself.&amp;nbsp; Admittedly this is a really simple operation and doesn't need much explanation, but I figured if I missed the new features someone else might to.&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;CODE&gt;&lt;FONT color=#0000ff&gt;private void&lt;/FONT&gt; button1_Click(&lt;FONT color=#0000ff&gt;object &lt;/FONT&gt;sender, &lt;FONT color=#7fffd4&gt;EventArgs&lt;/FONT&gt; e)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;FONT color=#008000&gt; //Create a DataSet&lt;BR&gt;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color=#7fffd4&gt;DataSet&lt;/FONT&gt; DemoDataSet = &lt;FONT color=#0000ff&gt;new &lt;/FONT&gt;&lt;FONT color=#7fffd4&gt;DataSet&lt;/FONT&gt;(&lt;FONT color=#a52a2a&gt;"CuckoozDataSet"&lt;/FONT&gt;);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color=#008000&gt;//Create a DataTable&lt;/FONT&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color=#7fffd4&gt;DataTable&lt;/FONT&gt; DemoTable = &lt;FONT color=#0000ff&gt;new&lt;/FONT&gt; &lt;FONT color=#7fffd4&gt;DataTable&lt;/FONT&gt;(&lt;FONT color=#a52a2a&gt;"Cuckoo"&lt;/FONT&gt;);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color=#008000&gt;//Add the Table to the DataSet&lt;/FONT&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DemoDataSet.Tables.Add(DemoTable);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color=#008000&gt;//Add a new Column and Set its Autoincrement property to true&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //just so that it has a value in it.&lt;/FONT&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color=#7fffd4&gt;DataColumn&lt;/FONT&gt; KeyColumn = &lt;FONT color=#0000ff&gt;new&lt;/FONT&gt; DataColumn(&lt;FONT color=#a52a2a&gt;"MainColumn"&lt;/FONT&gt;, &lt;FONT color=#0000ff&gt;typeof&lt;/FONT&gt;(System.&lt;FONT color=#7fffd4&gt;Int32&lt;/FONT&gt;));&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; KeyColumn.AutoIncrement = &lt;FONT color=#0000ff&gt;true&lt;/FONT&gt;;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DemoTable.Columns.Add(KeyColumn);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Add a row&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color=#7fffd4&gt;DataRow&lt;/FONT&gt; dro = DemoTable.NewRow();&lt;BR&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DemoTable.Rows.Add(dro);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color=#008000&gt;//Add 9 more so that we have 10 rows total&lt;/FONT&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (&lt;FONT color=#7fffd4&gt;Int32&lt;/FONT&gt; x = 0; x &amp;lt; 9; x++)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dro = DemoTable.NewRow();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DemoTable.Rows.Add(dro);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color=#008000&gt;//Verify the Row Count&lt;BR&gt;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color=#7fffd4&gt;Debug&lt;/FONT&gt;.Assert(DemoTable.Rows.Count == 10, &lt;FONT color=#a52a2a&gt;"Row Count is screwy"&lt;/FONT&gt;); &lt;BR&gt;&lt;BR&gt;&lt;FONT color=#008000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Verify that there are changes present&lt;/FONT&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color=#7fffd4&gt;Debug&lt;/FONT&gt;.Assert(DemoDataSet.HasChanges(), &lt;FONT color=#a52a2a&gt;"No Changes are present"&lt;/FONT&gt;);&lt;BR&gt;&amp;nbsp;&amp;nbsp; &lt;FONT color=#008000&gt;//Call AcceptChanges to reset the Rowstate of each row&lt;BR&gt;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp; DemoTable.AcceptChanges();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;FONT color=#008000&gt;//Verify that there are no changes present&lt;/FONT&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &lt;FONT color=#7fffd4&gt;Debug&lt;/FONT&gt;.Assert(!DemoDataSet.HasChanges(), &lt;FONT color=#a52a2a&gt;"Changes are present but shouldn't be"&lt;/FONT&gt;);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;FONT color=#008000&gt; //Call the SetAdded method on first 3 rows&lt;/FONT&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &lt;FONT color=#0000ff&gt;for&lt;/FONT&gt; (&lt;FONT color=#7fffd4&gt;Int32&lt;/FONT&gt; i = 0; i &amp;lt; 3; i++)&lt;BR&gt;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DemoTable.Rows[i].SetAdded();&lt;BR&gt;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp; //Call the SetModified method on the next 3 rows&lt;BR&gt;&amp;nbsp;&amp;nbsp; &lt;FONT color=#0000ff&gt;for&lt;/FONT&gt; (&lt;FONT color=#7fffd4&gt;Int32&lt;/FONT&gt; z = 3; z &amp;lt; 6; z++)&lt;BR&gt;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DemoTable.Rows[z].SetModified();&lt;BR&gt;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp; //Show the rowstate for each row&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;FONT color=#0000ff&gt; for&lt;/FONT&gt; (&lt;FONT color=#7fffd4&gt;Int32&lt;/FONT&gt; y = 0; y &amp;lt; DemoTable.Rows.Count; y++)&lt;BR&gt;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color=#7fffd4&gt;Debug&lt;/FONT&gt;.WriteLine(DemoTable.Rows[y].RowState.ToString());&lt;BR&gt;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp; &lt;FONT color=#008000&gt;//Show output&lt;BR&gt;&amp;nbsp;&amp;nbsp; //0 - Added&lt;BR&gt;&amp;nbsp;&amp;nbsp; //1 - Added&lt;BR&gt;&amp;nbsp;&amp;nbsp; //2 - Added&lt;BR&gt;&amp;nbsp;&amp;nbsp; //3 - Modified&lt;BR&gt;&amp;nbsp;&amp;nbsp; //4 - Modified&lt;BR&gt;&amp;nbsp;&amp;nbsp; //5 - Modified&lt;BR&gt;&amp;nbsp;&amp;nbsp; //6 - Unchanged&lt;BR&gt;&amp;nbsp;&amp;nbsp; //7 - Unchanged&lt;BR&gt;&amp;nbsp;&amp;nbsp; //8 - Unchanged&lt;BR&gt;&amp;nbsp;&amp;nbsp; //9 - Unchanged&lt;BR&gt;&amp;nbsp;&amp;nbsp; //Verify that there are changes present&lt;BR&gt;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp; &lt;FONT color=#7fffd4&gt;Debug&lt;/FONT&gt;.Assert(DemoDataSet.HasChanges(), &lt;FONT color=#a52a2a&gt;"There aren't changes but should be"&lt;/FONT&gt;);&lt;BR&gt;}&lt;BR&gt;&lt;/CODE&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=81063" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Data+Access/default.aspx">Data Access</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/.NET+General/default.aspx">.NET General</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Visual+Studio+.NET+2005/default.aspx">Visual Studio .NET 2005</category></item><item><title>Misc Observations on Biztalk</title><link>http://msmvps.com/blogs/williamryan/archive/2005/11/30/77270.aspx</link><pubDate>Wed, 30 Nov 2005 15:36:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:77270</guid><dc:creator>William</dc:creator><slash:comments>14</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/rsscomments.aspx?PostID=77270</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/commentapi.aspx?PostID=77270</wfw:comment><comments>http://msmvps.com/blogs/williamryan/archive/2005/11/30/77270.aspx#comments</comments><description>&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;Yesterday, to my surprise, there was quite a bit of hype about Biztalk 2006.&amp;nbsp; As far as the marketing hype went, I'll go so far as to say that it was featured almost as prominently as Visual Studio 2005 and Sql Server 2005.&amp;nbsp; There were a few differences though.&amp;nbsp; The main one is that you got a coupon for a copy of it, they didn't actually distribute a copy of it there.&amp;nbsp; big friggin deal though - most folks have it w/ MSDN or Technet and if you're using it professionally, well, then you probably already have access to it.&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;I've had a pretty positive relationship with Biztalk to date and think that it's really cool.&amp;nbsp;&amp;nbsp; I also tend the think it's tragically overpriced and has a rather schizophrenic relationship with the marketplace.&amp;nbsp; Why do I say that?&amp;nbsp;How many people do you know that have successful Biztalk installs and aren't scared up from getting it running?&amp;nbsp; They're out there, but compared to the number of people that have problems with it, well, the ratio is fugly.&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;Over and over I heard/overhead the same theme - &amp;#8220;Yeah, if you want to seamlessly map a text file to your database, Biztalk is great, but not for 50k&amp;#8221;.&amp;nbsp; Ok, that's not an exact quote but that captures the essence of it.&amp;nbsp; I also heard a lot of &amp;#8220;Ok, I see the slick demos but where are the people out there that have used it and say it's a good value?&amp;#8221;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;Now all of this is anecdotal evidence, but I didn't hear anything but glowing reviews of Visual Studio 2005.&amp;nbsp; I heard almost 100% positive stuff about Sql Server 2005 - except I heard a good bit of carping about creating maintenance plans - go figure.&amp;nbsp; So you have three products that are featured with approximately the same degree of prominence, and two of the products are so well recieved by the market people are giddy over them, and the other is recieved with, well, less than impressive ado.&amp;nbsp; Yes, I know Biztalk is a very targeted tool not applicable to many people's day to day routines.&amp;nbsp; But something just seems 'wrong' with respect to how it's recieved.&amp;nbsp; Mention ASP.NET 2.0 and people are ecstatic.&amp;nbsp; Mention Service Broker and people are giddy.&amp;nbsp; Mention Biztalk and you hear stuff like &amp;#8220;I can write my own tool to map a text file to my database.&amp;#8221;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;Before BTS 2004, I only knew two people that actually used Biztalk and they spoke very well of it but said it was quite a bit of work.&amp;nbsp; With Biztalk 2004, I've seen both the good and the bad with it - &lt;A href="http://www.codemilitia.com/blogs/tobin.titus/default.aspx"&gt;Tobin&lt;/A&gt; can speak to it a little better than I can.&amp;nbsp; I have a handful of friends like &lt;A href="http://www.scottcreynolds.com/"&gt;Scott&lt;/A&gt;&amp;nbsp;that have used it and I know &lt;A href="http://www.dunntraining.com/"&gt;Mark&lt;/A&gt; does quite a bit of training with it, but that's about it.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;Anyway, is it&amp;nbsp;me or does BTS have a little bit of an image problem.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=77270" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/williamryan/archive/tags/.NET+General/default.aspx">.NET General</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Visual+Studio+.NET+2005/default.aspx">Visual Studio .NET 2005</category></item><item><title>All Express Products will be free for a year.</title><link>http://msmvps.com/blogs/williamryan/archive/2005/11/07/74653.aspx</link><pubDate>Mon, 07 Nov 2005 23:38:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:74653</guid><dc:creator>William</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/rsscomments.aspx?PostID=74653</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/commentapi.aspx?PostID=74653</wfw:comment><comments>http://msmvps.com/blogs/williamryan/archive/2005/11/07/74653.aspx#comments</comments><description>&lt;A href="http://msdn.microsoft.com/vstudio/express/"&gt;&lt;FONT face=Tahoma size=2&gt;Read on&lt;/FONT&gt;&lt;/A&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=74653" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Visual+Studio+.NET+2005/default.aspx">Visual Studio .NET 2005</category></item><item><title>SqlBulkCopy</title><link>http://msmvps.com/blogs/williamryan/archive/2005/08/21/63629.aspx</link><pubDate>Sun, 21 Aug 2005 22:33:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:63629</guid><dc:creator>William</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/rsscomments.aspx?PostID=63629</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/commentapi.aspx?PostID=63629</wfw:comment><comments>http://msmvps.com/blogs/williamryan/archive/2005/08/21/63629.aspx#comments</comments><description>&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;Kim just got a new Media Center PC and I loaded the latest Visual Studio 2005 bits on it.&amp;nbsp; Got a little frustrated with XPath so I took a little while away to see what's going on with the ADO.NET 2.0 Library.&amp;nbsp; When I had played with the SqlBulkCopy&lt;BR&gt;before, I'm not sure if I just missed it or if they weren't there but there's lots o good stuff now.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;SqlBulkCopyOptions - There are 7 enum values for this and combined, they&lt;BR&gt;give you an amazing amount of control over the copy procedure.&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;&lt;STRONG&gt;Default&lt;/STRONG&gt; - Nothing special here, it just uses the default settings.&amp;nbsp; As a rule, the defaults are structured in such a way that they'll do the least amount of checking. Basically, they are set at the most permissive level available. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;&lt;STRONG&gt;CheckConstraints&lt;/STRONG&gt; does just what it says, it verifies CheckConstraints as the data is &lt;BR&gt;being inserted and if anything violates them, it yells.&lt;BR&gt;&lt;STRONG&gt;KeepNulls&lt;/STRONG&gt; - another real shocker here.&amp;nbsp; If you have default values set on your tables&lt;BR&gt;KeepNulls will cause them to be ignored.&amp;nbsp; &lt;/FONT&gt;&lt;FONT face=Tahoma size=2&gt;&lt;BR&gt;&lt;STRONG&gt;TableLock&lt;/STRONG&gt; - by default, Row locks are used as the data is loaded.&amp;nbsp; This is the least intrusive&lt;BR&gt;way to do an update, particularly in cases where you're dealing with a lot of data.&amp;nbsp; Obviously,&lt;BR&gt;if you lock the entire table, not much else is going to be done while the lock is in place.&lt;BR&gt;I haven't done the performance tests yet but it looks like the reason for this is performance.&lt;BR&gt;You lock the whole table but the operations go faster.&amp;nbsp; This is just conjecture on my part&lt;BR&gt;but if you didn't get a performance benefit, it's hard to see where you'd want to lock the whole table&lt;BR&gt;in most instance.&lt;BR&gt;&lt;STRONG&gt;KeepIdentity&lt;/STRONG&gt; - again, this is simply another mechanism to allow you to override what the &lt;BR&gt;database would naturally do.&amp;nbsp; It will use the identity values that you have in place&lt;BR&gt;versus generating new ones.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT face=Tahoma&gt;&lt;STRONG&gt;FireTriggers&lt;/STRONG&gt;&amp;nbsp;- by default, this is off.&amp;nbsp; When off, none of the database's triggers are fired.&amp;nbsp; When it's on, they do.&amp;nbsp; Again, you probably could have guessed this without me commenting on it.&amp;nbsp; Yet it's another way that you can precisely control your updates.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT face=Tahoma&gt;&lt;STRONG&gt;UseInternalTransaction&lt;/STRONG&gt;&amp;nbsp;- i haven't been able to verify that this actually works the way I understand it to.&amp;nbsp; That probably means I'm mistaken.&amp;nbsp; Essentially, you set this and each update occurs locally within the context of its own transaction.&amp;nbsp; If you specify another transaction for it, an exception will be raised.&amp;nbsp; That definitely works as advertised.&amp;nbsp; .&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;-----------&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;There are a few other features that really allow you to finely tune your updates, most of them are very intuitve as well:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&lt;FONT color=#0000ff&gt;public static void&lt;/FONT&gt; Adapter()&lt;BR&gt;{ &lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&amp;nbsp;&amp;nbsp; &lt;FONT color=#006400&gt;&lt;FONT color=#7fffd4&gt;&lt;STRONG&gt;SqlConnection&lt;/STRONG&gt;&lt;/FONT&gt; &lt;/FONT&gt;&lt;FONT color=#000000&gt;cn&lt;/FONT&gt; = &lt;FONT color=#0000ff&gt;new&lt;/FONT&gt; &lt;FONT color=#7fffd4&gt;&lt;STRONG&gt;SqlConnection&lt;/STRONG&gt;&lt;/FONT&gt;(CONNECTION_STRING);&lt;BR&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;&lt;FONT color=#7fffd4&gt;SqlBulkCopy &lt;/FONT&gt;&lt;/STRONG&gt;bc = &lt;FONT color=#0000ff&gt;new&lt;/FONT&gt; &lt;FONT color=#7fffd4&gt;SqlBulkCopy&lt;/FONT&gt;(cn, &lt;STRONG&gt;&lt;FONT color=#7fffd4&gt;SqlBulkCopyOptions&lt;/FONT&gt;&lt;/STRONG&gt;.Default);&lt;BR&gt;&amp;nbsp;&amp;nbsp; bc.NotifyAfter = 10;&lt;BR&gt;&amp;nbsp;&amp;nbsp; bc.SqlRowsCopied += &lt;FONT color=#0000ff&gt;new&lt;/FONT&gt; &lt;FONT color=#7fffd4&gt;&lt;STRONG&gt;SqlRowsCopiedEventHandler&lt;/STRONG&gt;&lt;/FONT&gt;(bc_SqlRowsCopied);&lt;BR&gt;&amp;nbsp;&amp;nbsp; bc.BatchSize = 100;&lt;BR&gt;}&lt;BR&gt;&lt;BR&gt;&lt;FONT color=#0000ff&gt;static void&lt;/FONT&gt; bc_SqlRowsCopied(&lt;FONT color=#0000ff&gt;object&lt;/FONT&gt; sender, &lt;FONT color=#7fffd4&gt;&lt;STRONG&gt;SqlRowsCopiedEventArgs&lt;/STRONG&gt;&lt;/FONT&gt; e)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.WriteLine("&lt;FONT color=#a52a2a&gt;10 More Rows have been copied, damn this is verbose!");&lt;/FONT&gt;&lt;BR&gt;}&lt;BR&gt;&lt;FONT face=Tahoma size=2&gt;NotifyAfter lets you specify an Int32 argument and after that many rows have been updated, the SqlRowsCopied event will be raised.&amp;nbsp; Underneath the line where I set the NotifyAfter property, i added the event handler.&amp;nbsp; Since I set it to 10, this would be pretty damn verbose in most instances, but if that's what floats your boat you can do it.&amp;nbsp; Just like the BatchSize of the SqlDataAdapter, you can set this.&amp;nbsp; So if you had 100 records and set this to 10, you'd have 10 trips to the db.&amp;nbsp; If the NotifyAfter property was set to 10, the SqlRowsCopied event would be raised 10 times.&lt;/FONT&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&lt;FONT face=Tahoma size=2&gt;This is a really cool option b/c up until now, there was no 'good' mechanism for data transfer.&amp;nbsp; You could always fake it by setting the AcceptChangesDuringFill property of your SqlDataAdapter to false, then use that table with a destination adapter and transfer data that way, but this was a hack and as such, was about the least efficient method to transfer data known to man.&amp;nbsp; This isn't a slight on the design of ADO.NET, it's just that disconnected architecture doesn't really lend itself well to large data transfers, at least&amp;nbsp; it didn't until now&lt;/FONT&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=63629" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Data+Access/default.aspx">Data Access</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Visual+Studio+.NET+2005/default.aspx">Visual Studio .NET 2005</category></item><item><title>2.0 Framwork Enhancements on System.XML - And misc ramblings</title><link>http://msmvps.com/blogs/williamryan/archive/2005/08/19/63456.aspx</link><pubDate>Sat, 20 Aug 2005 02:53:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:63456</guid><dc:creator>William</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/rsscomments.aspx?PostID=63456</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/commentapi.aspx?PostID=63456</wfw:comment><comments>http://msmvps.com/blogs/williamryan/archive/2005/08/19/63456.aspx#comments</comments><description>&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;For the past few weeks, I've been upskilling as the &lt;A href="http://www.brains-n-brawn.com/"&gt;lower cased one&lt;/A&gt; calls it.&amp;nbsp; I'm also to get back into the groove at the newsgroups and about the only thing I'm slacking on is support over at my beloved &lt;A href="http://www.devbuzz.com/"&gt;Devbuzz&lt;/A&gt; which I'll be getting back into this weekend.&amp;nbsp; Stuff I've been working on mainly consists of learning System.Xml inside and out (and of course XPath and XSLT), Speech Server and miscellaneous tidbits of 2.0 stuff.&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;The fact that I'm an ADO.NET junkie is probably readily obvious.&amp;nbsp;&amp;nbsp; And recently, I've realized that as much as I love ADO.NET, I've been using it as a crutch.&amp;nbsp; Don't get me wrong, this has nothing to do with flaws in ADO.NET, it has flaws to do with Bill.&amp;nbsp; So why is it&amp;nbsp; a crutch?&amp;nbsp; Well, the quote is attributed to a lot of different people, but it says essentially &amp;#8220;He who is good with a hammer sees the world as a nail.&amp;#8221;&amp;nbsp; This is particularly true in my case.&amp;nbsp; I don't think there's a problem out there that I can't solve using a DataRelation, DataTable.Select, DataTable.Compute, GetChildRows and WriteXml, ReadXml.&amp;nbsp; If it's XML and I need to manipulate it, I can read it into a dataset, count the tables, count the rows in each table and start DataTable.Select ing or DataView.RowFilter ing.&amp;nbsp; The problem arises when I need to get it back into XML.&amp;nbsp; And what I often do is just use WriteXml and work around it (or tell guy on the other end to work around it).&amp;nbsp; This is LAME on my part so I decided to cure it.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;Well, that's my story and I'm sticking with it.&amp;nbsp; Probably the 'real' reason I decided to learn XML is because I wanted to outPimp &lt;A href="http://codebetter.com/blogs/sahil.malik/default.aspx"&gt;el Maliko&lt;/A&gt;&amp;nbsp;in ADO.NET and I can't get there without XML.&amp;nbsp; Actually, that's not the real reason either.&amp;nbsp; The real reason is because theres a newly minted MVP who's notorious for convoluted and inaccurate answers and I've been reading his posts.&amp;nbsp; I typically look down my nose at him with disdain b/c I think he's a jerk and his answers are either incorrect or plagairized.&amp;nbsp; Anyway, every friggin XML question that pops up, he uses the same method I did.&amp;nbsp; People ask about XPathIterators and he goes into 'load it into a dataset'.&amp;nbsp; I was never that bad but I was close.&amp;nbsp; Anyway, I'm 1/3 of my way to my goal.&amp;nbsp; Right now I own a few chunks of the System.Xml namespace, XPath in particular.&amp;nbsp; XSLT is giving me a little trouble, not so much with the syntax but wiht knowing what the f*** I want to transform everything to.&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;If you are using DataSets and you need to give people Xml in a specific format, probably the best bet is to use Xslt.&amp;nbsp; From what I can tell, it's either that, or iterate the DataTables and build an XML document as you iterate them.&amp;nbsp; This is a royal pain in the a33 and of very little value. Code wise it's a nightmare and if you need to change the output, you need to recompile as opposed to just editing your Xslt. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;String FailoverNamespace = "williamgryan.cuckoozbackup.com";&lt;BR&gt;&lt;BR&gt;xmlPen.WriteStartDocument();&lt;BR&gt;xmlPen.WriteStartElement("Cuckooz", PrimaryNamespace);&lt;BR&gt;xmlPen.WriteStartElement("Cuckoo", PrimaryNamespace);&lt;BR&gt;xmlPen.WriteEndElement();&lt;BR&gt;xmlPen.WriteEndElement();&lt;BR&gt;xmlPen.WriteEndDocument();&lt;BR&gt;xmlPen.Close();&lt;BR&gt;2.0 Way&lt;BR&gt;Now you can just use the static Create method&lt;BR&gt;XmlWriter xmlPen = XmlWriter.Create&lt;BR&gt;(@"C:\Upskilling\XML\samplecuckoo.xml");&lt;BR&gt;Ok, not much different, until you look at the friggin &lt;BR&gt;overloads. Now you can use the&lt;BR&gt;XmlWriterSettings class...&lt;BR&gt;XmlWriterSettings docSettings = new XmlWriterSettings();&lt;BR&gt;docSettings.Indent = {true/false};&lt;BR&gt;docSettings.CloseOutput = {true/false};&lt;BR&gt;docSettings.Encoding = 'Any value of the Encoding &lt;BR&gt;enumeration ie UTF16&lt;BR&gt;docSettings.ConformamceLevel = &lt;BR&gt;ConformanceLevel.Fragment;&lt;BR&gt;You can set most of the behavioral settings here and then &lt;BR&gt;just pass it in the in&lt;BR&gt;the constructor:&lt;BR&gt;XmlWriter xmlPen = XmlWriter.Create&lt;BR&gt;(@"C:\Upskilling\XML\samplecuckoo.xml", docSettings);&lt;BR&gt;&lt;/CODE&gt;&lt;BR&gt;&lt;FONT face=Tahoma size=2&gt;Ok, this is a lame example I know. I'm working on a class to read through the RSS feed using some of the new 2.0 Objects.&amp;nbsp; Let me finish that up and I'll post it in a few hours. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;The long and short of it is though - that XML is becoming a lot more data centric, particularly in the 2.0 framework and the days of getting by withouth really being able to navigate and manipulate it are coming to an end.&amp;nbsp; At least they are for me.&lt;/FONT&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=63456" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Visual+Studio+.NET+2005/default.aspx">Visual Studio .NET 2005</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Coding+Techniques/default.aspx">Coding Techniques</category></item><item><title>System.Data.FillLoadOption</title><link>http://msmvps.com/blogs/williamryan/archive/2005/07/29/59918.aspx</link><pubDate>Sat, 30 Jul 2005 02:18:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:59918</guid><dc:creator>William</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/rsscomments.aspx?PostID=59918</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/commentapi.aspx?PostID=59918</wfw:comment><comments>http://msmvps.com/blogs/williamryan/archive/2005/07/29/59918.aspx#comments</comments><description>&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;System.Data.FillLoadOption is one of the cool new features of the ADO.NET 2.0 SqlDataAdapter.&amp;nbsp; In the new framework, we have a lot more control over the inner workings of the DataAdapter and hopefully&amp;nbsp; it will shed it's stereotype of being a &amp;#8220;Black Box&amp;#8221;.&amp;nbsp; Below is the basic workings of it - nothing new here that you can't find in the documentation but I figured I'd mention it:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;SqlDataAdapter da = new SqlDataAdapter();&lt;BR&gt;&lt;BR&gt;//The current and original values will be set to the&lt;BR&gt;//new query values&lt;BR&gt;da.FillLoadOption = System.Data.LoadOption.OverwriteChanges;&lt;BR&gt;//The new query values will overwrite the original values.&lt;BR&gt;//However the current values for the row won't be changed.&lt;BR&gt;da.FillLoadOption = System.Data.LoadOption.PreserveChanges;&lt;BR&gt;&lt;BR&gt;//The new query values will overwrite the current values of the row&lt;BR&gt;//However the original values won't be changed.&lt;BR&gt;da.FillLoadOption = System.Data.LoadOption.Upsert;&lt;BR&gt;&lt;/CODE&gt;&lt;FONT face=Tahoma size=2&gt;I gotta give it to the ADO.NET 2.0 team for the name Upsert.&amp;nbsp; Most of the framework oozes of the Consistency Police (which is a good thing - I"m not criticising that) and this looks like a name they came up with after Happy Hour on Friday.&amp;nbsp; Anyway, right now you have very little control over your Fill.&amp;nbsp; Ifyou have&amp;nbsp; rows and you don't have a key, calling Fill again will result in x + 1 sets of the same data.&amp;nbsp; If you have a key, the behavior is different.&amp;nbsp; It will look to the keyed rows and overwrite the&amp;nbsp; values with the new ones.&amp;nbsp; However, depending on your needs, this can be inconvenient.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;Anyway, one thing I've been working on that is going VERY Slow but moving - is rewriting the Data Access Application Block to accomodate the new features of the 2.0 Framework.&amp;nbsp; There's a lot there though in terms of work even though the features aren't that dramatic in terms of size (however the functionality is very impressive).&amp;nbsp; What I'm saying is that the new features typically provide quite a bit of bang for the buck.&amp;nbsp; If you're interested in working on this - please let me know.&amp;nbsp; I'll be setting up a workspace on GotDotNet and if you're interested, please let me know.&lt;/FONT&gt;&lt;BR&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=59918" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Data+Access/default.aspx">Data Access</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/.NET+General/default.aspx">.NET General</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Visual+Studio+.NET+2005/default.aspx">Visual Studio .NET 2005</category></item><item><title>OOP, Generics and a little Humor</title><link>http://msmvps.com/blogs/williamryan/archive/2005/07/25/59599.aspx</link><pubDate>Tue, 26 Jul 2005 00:15:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:59599</guid><dc:creator>William</dc:creator><slash:comments>6</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/rsscomments.aspx?PostID=59599</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/commentapi.aspx?PostID=59599</wfw:comment><comments>http://msmvps.com/blogs/williamryan/archive/2005/07/25/59599.aspx#comments</comments><description>&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;Well, I decided to show a few examples with a little humor.&amp;nbsp; I know a few of you thought my &amp;#8220;Shocker&amp;#8221; post was in poor taste, and I apologize if you did, but obviously many people liked it.&amp;nbsp; Anyway, I'm gonig to show a few examples of how to make a class better, and better and better, and use the Shocker as an example.&amp;nbsp; So at first, I'll implement it as lame as possible.&amp;nbsp; Then I'll build on it and quickly show how to make an infinitely better implementation.&amp;nbsp; Then, we'll actually add some smarts to it so we can make sure that only valid values can be set.&amp;nbsp; I'll be using Generics to help this process.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;CODE&gt;&lt;FONT color=#0000ff&gt;namespace&lt;/FONT&gt; &lt;STRONG&gt;DoubleI&lt;/STRONG&gt;.TheShocker&lt;BR&gt;{&lt;BR&gt;&lt;FONT color=#0000ff&gt;#region&lt;/FONT&gt; Using Statements&lt;BR&gt;&amp;nbsp;&amp;nbsp; &lt;FONT color=#0000ff&gt;using&lt;/FONT&gt; System;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &lt;FONT color=#0000ff&gt;using&lt;/FONT&gt; System.Collections.Generic;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &lt;FONT color=#0000ff&gt;using&lt;/FONT&gt; System.Text;&lt;BR&gt;&lt;FONT color=#0000ff&gt;#endregion&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;class&lt;/FONT&gt; &lt;FONT color=#006400&gt;Shocker&lt;/FONT&gt;&lt;BR&gt;{&lt;BR&gt;&lt;FONT color=#0000ff&gt;&amp;nbsp; private&lt;/FONT&gt; &lt;FONT color=#006400&gt;String&lt;/FONT&gt; _oneValue;&lt;BR&gt;&lt;FONT color=#0000ff&gt;&amp;nbsp; private&lt;/FONT&gt; &lt;FONT color=#006400&gt;String&lt;/FONT&gt; _twoValue;&lt;BR&gt;&lt;FONT color=#0000ff&gt;&amp;nbsp; public&lt;/FONT&gt; Shocker(&lt;FONT color=#006400&gt;String&lt;/FONT&gt; oneValue, &lt;FONT color=#006400&gt;String&lt;/FONT&gt; twoValue)&lt;BR&gt;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color=#0000ff&gt;this&lt;/FONT&gt;.OneValue = OneValue;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color=#0000ff&gt;this&lt;/FONT&gt;.TwoValue = TwoValue;&lt;BR&gt;&amp;nbsp; }&lt;BR&gt;&lt;FONT color=#0000ff&gt;&amp;nbsp; public &lt;/FONT&gt;&lt;FONT color=#006400&gt;String&lt;/FONT&gt; OneValue&lt;BR&gt;&amp;nbsp; {&lt;BR&gt;&lt;FONT color=#0000ff&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; get&lt;/FONT&gt; { &lt;FONT color=#0000ff&gt;return&lt;/FONT&gt; _oneValue; }&lt;BR&gt;&lt;FONT color=#0000ff&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set&lt;/FONT&gt; { _oneValue =&lt;FONT color=#0000ff&gt; value&lt;/FONT&gt;; }&lt;BR&gt;&amp;nbsp; }&lt;BR&gt;&lt;FONT color=#0000ff&gt;&amp;nbsp; public &lt;/FONT&gt;&lt;FONT color=#006400&gt;String&lt;/FONT&gt; TwoValue&lt;BR&gt;&amp;nbsp; {&lt;BR&gt;&lt;FONT color=#0000ff&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; get&lt;/FONT&gt; { &lt;FONT color=#0000ff&gt;return&lt;/FONT&gt; _twoValue; }&lt;BR&gt;&lt;FONT color=#0000ff&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set&lt;/FONT&gt; { _twoValue = &lt;FONT color=#0000ff&gt;value&lt;/FONT&gt;; }&lt;BR&gt;&amp;nbsp; }&lt;BR&gt;&lt;FONT color=#0000ff&gt;&amp;nbsp; public override &lt;/FONT&gt;&lt;FONT color=#006400&gt;String&lt;/FONT&gt; ToString()&lt;BR&gt;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color=#0000ff&gt;return&lt;/FONT&gt; &lt;FONT color=#006400&gt;String&lt;/FONT&gt;.Format("One in the {0}, Two in the {1}",&lt;BR&gt;&lt;FONT color=#0000ff&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;this&lt;/FONT&gt;.OneValue,&lt;BR&gt;&lt;FONT color=#0000ff&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;this&lt;/FONT&gt;.TwoValue);&lt;BR&gt;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;}&lt;BR&gt;}&lt;BR&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=59599" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Visual+Studio+.NET+2005/default.aspx">Visual Studio .NET 2005</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Coding+Techniques/default.aspx">Coding Techniques</category></item><item><title>Oracle 10g Lite ADO.NET Adapter</title><link>http://msmvps.com/blogs/williamryan/archive/2005/07/18/58024.aspx</link><pubDate>Tue, 19 Jul 2005 03:36:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:58024</guid><dc:creator>William</dc:creator><slash:comments>5</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/rsscomments.aspx?PostID=58024</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/commentapi.aspx?PostID=58024</wfw:comment><comments>http://msmvps.com/blogs/williamryan/archive/2005/07/18/58024.aspx#comments</comments><description>&lt;FONT face=Tahoma size=2&gt;Ok, so I read about it on &lt;A href="http://blogs.msdn.com/mikezintel/"&gt;Mike's&lt;/A&gt;&amp;nbsp;as well as the &lt;A href="http://blogs.msdn.com/netcfteam/archive/2005/06/23/431948.aspx"&gt;Compact Framework Team&lt;/A&gt;&amp;nbsp;but I sure can't find it anywhere.&amp;nbsp; I'm probably just having a case of idiocy flare up, but I've been trying to find it for 30 minutes now.&amp;nbsp; If you know where I can grab it, please let me know.&lt;/FONT&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=58024" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Compact+Framework/default.aspx">Compact Framework</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Data+Access/default.aspx">Data Access</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Visual+Studio+.NET+2005/default.aspx">Visual Studio .NET 2005</category></item></channel></rss>