<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1139322805879086422</id><updated>2012-01-26T00:12:30.714-08:00</updated><category term='mobile'/><category term='flash'/><category term='non-constant'/><category term='post back'/><category term='conditional comments'/><category term='windows phone 7'/><category term='default value'/><category term='a'/><category term='downlevel-revealed'/><category term='events'/><category term='Apple'/><category term='phone'/><category term='application state'/><category term='c#'/><category term='float property'/><category term='firefox'/><category term='submit'/><category term='confirm'/><category term='wp7'/><category term='css'/><category term='connection string'/><category term='asp .net 3.5'/><category term='resources'/><category term='prometric'/><category term='attributes'/><category term='html attributes'/><category term='app'/><category term='App Store'/><category term='.net'/><category term='sqldatasource'/><category term='iDraw n Paint'/><category term='iOS'/><category term='google logo'/><category term='opera'/><category term='web.config'/><category term='nearby'/><category term='wmode'/><category term='black and white'/><category term='reviews'/><category term='java'/><category term='os'/><category term='blackle'/><category term='windowless'/><category term='dataset'/><category term='state'/><category term='datareader'/><category term='mvc'/><category term='directions'/><category term='iPhone'/><category term='software'/><category term='conserve energy'/><category term='html'/><category term='mac'/><category term='document information panels'/><category term='design'/><category term='parameter'/><category term='bi-winning'/><category term='ado .net'/><category term='blogging'/><category term='moss'/><category term='macintel'/><category term='enter key press'/><category term='google'/><category term='state management'/><category term='anchors'/><category term='ado .net 3.5'/><category term='multi-touch'/><category term='asp .net tags'/><category term='javascript'/><category term='html events'/><category term='asp .net'/><category term='trace'/><category term='transparent'/><category term='microsoft sharepoint office server'/><category term='just draw'/><category term='application'/><category term='access modifiers'/><category term='google in black'/><category term='form'/><category term='browser'/><category term='sharepoint server'/><category term='draw'/><category term='background'/><category term='cursor: pointer'/><category term='content types'/><category term='downlevel-hidden'/><category term='database'/><category term='operating system'/><category term='exam'/><category term='navigation'/><category term='earth hour'/><category term='stored procedure'/><category term='silverlight'/><category term='internet explorer'/><category term='sketch'/><category term='exception. raise'/><category term='view state'/><category term='throw'/><category term='beta exams'/><category term='first'/><category term='asp:button'/><category term='post'/><category term='doubly linked'/><category term='blog'/><category term='button'/><category term='sql server'/><category term='ie'/><category term='null'/><category term='gps'/><category term='stack'/><category term='default access modifiers'/><category term='mcpd'/><category term='call'/><category term='linked list'/><category term='microsoft'/><category term='singly linked'/><category term='mozilla'/><category term='make google black'/><category term='iPad'/><category term='maps'/><category term='data'/><category term='free online training'/><title type='text'>dot NET affairs</title><subtitle type='html'>Here you might find tips, tricks, gotchas and other useful information regarding the Microsoft .NET framework. The material posted is relevant to the MCPD exams, web programming in ASP .NET, and other .NET technologies. It is a way for me to document things I encounter in .NET.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dotnetaffairs.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://dotnetaffairs.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>T Alrahem</name><uri>http://www.blogger.com/profile/09938150493349755377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>35</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1139322805879086422.post-9111240591218071069</id><published>2012-01-25T18:53:00.000-08:00</published><updated>2012-01-25T23:52:38.444-08:00</updated><title type='text'>How to Release iOS Ad Hoc Beta Builds with Xcode</title><content type='html'>&lt;div&gt;&lt;span style="text-align: left; "&gt;After you have a running app and you have done enough testing on your iPhone and your other &lt;/span&gt;&lt;a href="http://en.wikipedia.org/wiki/IDevice" style="text-align: left; "&gt;iDevices&lt;/a&gt;&lt;span style="text-align: left; "&gt;, the next step before submitting to the AppStore is to test on as many devices as possible. This type of testing is usually called &lt;/span&gt;&lt;a href="http://en.wikipedia.org/wiki/Beta_testing#Beta_testing" style="text-align: left; "&gt;beta testing&lt;/a&gt;&lt;span style="text-align: left; "&gt;. Beta testing is crucial in developing a great mobile app because of generally two types of feedback given by beta testers:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;Compatibility problems. Even though everything might be sweet and sublime on your iPhone or iPad, it might not be the case for every combination of device and iOS version. Beta testing with hardware/software diverse testers will uncover all or most of those problems.&lt;/li&gt;&lt;li&gt;General story/usability flaws. This category is not about bugs. It's about understanding what part was confusing to your beta users or what false assumptions did you make. Beta testing will help bring your assumptions and perspective inline with real users.&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;In this guide I will give the procedure for how to generate ad hoc builds that you can send to your beta testers to try. I could not find a single tutorial that covered all the related issues so I decided to write this. This procedure does &lt;i&gt;not &lt;/i&gt;require registering in the iOS Developer &lt;i&gt;Enterprise&lt;/i&gt; Program. All that is required is the standard iOS Developer Program. This guide was written using Xcode 4.2.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;Ask your users for their device ID's and add them in the iOS Provisioning Portal. Testers can find their device ID's from iTunes or from Xcode in the Organizer window. Using TestFlight (more on that later) can also simplify getting device ID's from users. TestFlight will email the tester's device ID once he/she registers.&lt;a href="http://3.bp.blogspot.com/-iB184d9Y7TA/TyDw7OBMmLI/AAAAAAAACZw/_u7sS8VMEPg/s1600/Screen%2Bshot%2B2012-01-25%2Bat%2B10.16.03%2BPM.png"&gt;&lt;img src="http://3.bp.blogspot.com/-iB184d9Y7TA/TyDw7OBMmLI/AAAAAAAACZw/_u7sS8VMEPg/s400/Screen%2Bshot%2B2012-01-25%2Bat%2B10.16.03%2BPM.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5701822028417112242" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 225px; " /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Create a Distribution Ad Hoc Provisioning profile in iOS Portal and select all the devices for the beta users.&lt;a href="http://3.bp.blogspot.com/-YbZODExVM8w/TyDxk1_BS0I/AAAAAAAACZ8/SfLZzztWTwI/s1600/Screen%2Bshot%2B2012-01-25%2Bat%2B10.19.13%2BPM.png"&gt;&lt;img src="http://3.bp.blogspot.com/-YbZODExVM8w/TyDxk1_BS0I/AAAAAAAACZ8/SfLZzztWTwI/s400/Screen%2Bshot%2B2012-01-25%2Bat%2B10.19.13%2BPM.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5701822743520037698" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 223px; " /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Download the new provisioning profile and install it in Xcode by double-clicking it or dragging it into the Xcode icon. Keep this file handy because we will need upload it to the web along with the ipa file and allow users to download it. Select this provisioning profile for code signing for the Release version of your project and targets.&lt;a href="http://3.bp.blogspot.com/-jIQGsji0Yks/TyDyp-wJSAI/AAAAAAAACaI/mlQ9GkXxK5k/s1600/Screen%2Bshot%2B2012-01-25%2Bat%2B10.27.51%2BPM.png"&gt;&lt;img src="http://3.bp.blogspot.com/-jIQGsji0Yks/TyDyp-wJSAI/AAAAAAAACaI/mlQ9GkXxK5k/s400/Screen%2Bshot%2B2012-01-25%2Bat%2B10.27.51%2BPM.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5701823931284539394" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 234px; " /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;li&gt;Select "iOS Device" from your build schemes. the Archive button is disabled when the Simulator is selected.&lt;div&gt;&lt;img src="http://1.bp.blogspot.com/-eSyeaqRQAK4/TyDSJkDcPqI/AAAAAAAACYc/CRwm9FcSCKk/s400/Screen%2Bshot%2B2012-01-25%2Bat%2B8.08.21%2BPM.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5701788189989813922" style="color: rgb(0, 0, 238); text-decoration: underline; display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 218px; " /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Add an Entitlements file. In Xcode 4.2 you &lt;i&gt;cannot&lt;/i&gt; add an Entitlements file by going to File -&amp;gt; New -&amp;gt; New File --like previous versions. You must select your project in the top left corner then click on your main target. Then scroll all the way to the bottom and check the box for Enable Entitlements.&lt;a href="http://2.bp.blogspot.com/-_hoy6CKOLD4/TyDTnssBpyI/AAAAAAAACYo/T8X3ByRDfSg/s1600/Screen%2Bshot%2B2012-01-25%2Bat%2B8.15.36%2BPM.png"&gt;&lt;img src="http://2.bp.blogspot.com/-_hoy6CKOLD4/TyDTnssBpyI/AAAAAAAACYo/T8X3ByRDfSg/s400/Screen%2Bshot%2B2012-01-25%2Bat%2B8.15.36%2BPM.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5701789807215224610" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 294px; " /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;If you have more than one target in your project then you must select "Yes" for the Skip Install setting under Deployment for all targets other than your main project target. You will end up with multiple targets if you are linking to other projects or have unit tests.&lt;a href="http://1.bp.blogspot.com/-kc96KqbWhWI/TyDoM1m3zgI/AAAAAAAACY0/WO5oJLwGI5I/s1600/Screen%2Bshot%2B2012-01-25%2Bat%2B8.20.05%2BPM.png"&gt;&lt;img src="http://1.bp.blogspot.com/-kc96KqbWhWI/TyDoM1m3zgI/AAAAAAAACY0/WO5oJLwGI5I/s400/Screen%2Bshot%2B2012-01-25%2Bat%2B8.20.05%2BPM.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5701812435497242114" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 297px; " /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;From the main menu select Product --&amp;gt; Archive.&lt;a href="http://4.bp.blogspot.com/-rveFbfK_gxs/TyDo6YaouyI/AAAAAAAACZA/95j3DF4YK_U/s1600/Screen%2Bshot%2B2012-01-25%2Bat%2B9.46.08%2BPM.png"&gt;&lt;img src="http://4.bp.blogspot.com/-rveFbfK_gxs/TyDo6YaouyI/AAAAAAAACZA/95j3DF4YK_U/s400/Screen%2Bshot%2B2012-01-25%2Bat%2B9.46.08%2BPM.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5701813217935276834" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 278px; " /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;From the Organizer - Archives window press the button Share.&lt;a href="http://3.bp.blogspot.com/-_k3zyQSCOqA/TyDpwKXE7CI/AAAAAAAACZM/tZuUHP3dUw8/s1600/Screen%2Bshot%2B2012-01-25%2Bat%2B9.49.32%2BPM.png"&gt;&lt;img src="http://3.bp.blogspot.com/-_k3zyQSCOqA/TyDpwKXE7CI/AAAAAAAACZM/tZuUHP3dUw8/s400/Screen%2Bshot%2B2012-01-25%2Bat%2B9.49.32%2BPM.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5701814141875186722" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 252px; " /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Select iOS App Store Package (.ipa) and the correct signing identity for your build. Then press Next.&lt;a href="http://2.bp.blogspot.com/-cc2498Rf53I/TyDqPmJFL_I/AAAAAAAACZY/H4wdxapehV0/s1600/Screen%2Bshot%2B2012-01-25%2Bat%2B9.51.49%2BPM.png"&gt;&lt;img src="http://2.bp.blogspot.com/-cc2498Rf53I/TyDqPmJFL_I/AAAAAAAACZY/H4wdxapehV0/s400/Screen%2Bshot%2B2012-01-25%2Bat%2B9.51.49%2BPM.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5701814681908621298" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 241px; " /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Type into the Save As field on top the name you want to give the files. Check the box for Save for Enterprise Distribution on the bottom. Enter the URL where the file will be hosted without the file name. All you need is the URL up to the directory path. Add a title for your app then press Save.&lt;a href="http://2.bp.blogspot.com/-d7eyUtQjxK4/TyDsFim5HjI/AAAAAAAACZk/_FjzRSr1jd0/s1600/Screen%2Bshot%2B2012-01-25%2Bat%2B10.00.07%2BPM.png"&gt;&lt;img src="http://2.bp.blogspot.com/-d7eyUtQjxK4/TyDsFim5HjI/AAAAAAAACZk/_FjzRSr1jd0/s400/Screen%2Bshot%2B2012-01-25%2Bat%2B10.00.07%2BPM.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5701816708184481330" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 265px; " /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;You should now have generated two files, a .ipa file and a .plist file. All you have to do now is upload these two files to your website along with your provisioning file (from step 3) then link to them on a webpage like shown below. The ipa and plist file must be in the same directory and must have the same name except for the extension. Your users should install the provisioning file first then install the app.&lt;br /&gt;&lt;br /&gt;Another option is instead of simply hosting these files on your website, you can utilize a service like &lt;a href="https://testflightapp.com/"&gt;TestFlight&lt;/a&gt; for better tracking and user experience. Using TestFlight is easy and you can use the TestFlight SDK to allow the users to send feedback and track how long the testers used the app and so on. For more on TestFlight visit: &lt;a href="https://testflightapp.com/"&gt;https://testflightapp.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;Install iOS App&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;a href=&amp;quot;My_Provisioning_Profile_Ad_Hoc.mobileprovision&amp;quot;&amp;gt;Install Team Provisioning File&amp;lt;/a&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;a href=&amp;quot;itms-services://?action=download-manifest&amp;amp;url=http://yourwebsite/betafolder/myFavAppName.plist&amp;quot;&amp;gt;Install Application&amp;lt;/a&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You should provide your testers with links to the provisioning profile (.mobileprovision) and IPA file as shown above. Instruct them to install the provisioning profile first. However you should look into TestFlight for better management and tracking. There, that should get you started with installing all your cool apps on your friends' devices before you hit the AppStore.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1139322805879086422-9111240591218071069?l=dotnetaffairs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetaffairs.blogspot.com/feeds/9111240591218071069/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1139322805879086422&amp;postID=9111240591218071069' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/9111240591218071069'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/9111240591218071069'/><link rel='alternate' type='text/html' href='http://dotnetaffairs.blogspot.com/2012/01/how-to-release-ios-ad-hoc-beta-builds.html' title='How to Release iOS Ad Hoc Beta Builds with Xcode'/><author><name>T Alrahem</name><uri>http://www.blogger.com/profile/09938150493349755377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-iB184d9Y7TA/TyDw7OBMmLI/AAAAAAAACZw/_u7sS8VMEPg/s72-c/Screen%2Bshot%2B2012-01-25%2Bat%2B10.16.03%2BPM.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1139322805879086422.post-5118133057059258335</id><published>2011-10-01T14:23:00.000-07:00</published><updated>2011-10-03T14:08:01.748-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linked list'/><category scheme='http://www.blogger.com/atom/ns#' term='doubly linked'/><category scheme='http://www.blogger.com/atom/ns#' term='software'/><category scheme='http://www.blogger.com/atom/ns#' term='design'/><category scheme='http://www.blogger.com/atom/ns#' term='bi-winning'/><category scheme='http://www.blogger.com/atom/ns#' term='singly linked'/><title type='text'>Use Doubly Linked Not Singly Linked Lists</title><content type='html'>If you're going to write a general use library and use a linked list, please make it doubly linked. I was recently working with the &lt;a href="http://box2d.org/"&gt;Box2d&lt;/a&gt; library which I have to say is a great physics engine. The engine maintains a linked list of what it calls Fixtures attached to each body. While I was trying to use this list I was shocked to find that it was a singly linked list. In other words the list only had a "next" pointer, no previous pointer.&lt;br /&gt;&lt;br /&gt;Unless you have a good reason like &lt;a href="http://en.wikipedia.org/wiki/Tail-sharing"&gt;tail-sharing&lt;/a&gt; I really don't see why someone would do that especially in a general opensource library that would be used in a broad range of applications.  First off, before we go into the pros and cons of both designs let's briefly talk about &lt;a href="http://en.wikipedia.org/wiki/Linked_list"&gt;linked lists&lt;/a&gt;. A linked list is a data structure used to store a group of data objects by connecting objects with a "link". The link is basically a pointer from one object to the next one, previous one, or both. If there's only one link it's called a singly linked list. If there's both a previous and a next link, it's called a doubly linked list. The best part about a linked list is that it's very cheap to add and remove objects. All we need to do is add a new link or remove a link and assign a pointer to a different object. The worst part about a linked list is random access. If we need to access an object that happens to be in the middle of the list, there's no way to reach that object but to traverse through all the objects before it or after it.&lt;br /&gt;&lt;br /&gt;When designing software, we're supposed make libraries as flexible and general as reasonably possible. We already know that access is the main weakness of linked lists. The least we can do to make accessing objects a little easier is to make the list a doubly linked one. In the case of linked lists it's easy to see why someone might need to go backwards in a list. But even if it weren't so obvious, if adding something doesn't cost much and it satisfies a common use it should be done in a general purpose type of library.&lt;br /&gt;&lt;br /&gt;Looking at the pros and cons of a singly and doubly linked list, it also makes more sense to make them doubly linked. The only pro of using singly linked lists is that it saves memory but all we're saving is a pointer which is about 32 or 64 bits per object. The con is being limited to traverse a list in only one direction. Singly linked lists also make it more challenging to delete objects. The pro of having a doubly linked list is that from any object in the list we can move in either direction. Also it's a lot easier to delete an object in a doubly linked list. The con of doubly linked lists is that we use a little more memory for the second pointer. However the additional memory (32 or 64 bits per object) used is insignificant. In terms of asymptotic notation, we're still using O(n) memory which means our memory usage is linear with respect to the number of objects.&lt;br /&gt;&lt;br /&gt;The good news is that I was able to modify the list and make it doubly linked. Take home message: bi-linking = bi-winning.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1139322805879086422-5118133057059258335?l=dotnetaffairs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetaffairs.blogspot.com/feeds/5118133057059258335/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1139322805879086422&amp;postID=5118133057059258335' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/5118133057059258335'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/5118133057059258335'/><link rel='alternate' type='text/html' href='http://dotnetaffairs.blogspot.com/2011/10/use-doubly-linked-not-singly-linked.html' title='Use Doubly Linked Not Singly Linked Lists'/><author><name>T Alrahem</name><uri>http://www.blogger.com/profile/09938150493349755377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1139322805879086422.post-1270506019018708911</id><published>2011-09-19T08:51:00.000-07:00</published><updated>2011-09-19T09:19:34.821-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='throw'/><category scheme='http://www.blogger.com/atom/ns#' term='call'/><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='trace'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><category scheme='http://www.blogger.com/atom/ns#' term='exception. raise'/><category scheme='http://www.blogger.com/atom/ns#' term='stack'/><title type='text'>throw vs throw ex: C# .NET Exceptions</title><content type='html'>There are a couple options to raise an exception again after it has been caught. One option is to raise the exception again by using the "throw exception" keyword like below:&lt;br /&gt;&lt;pre class="code"&gt;&lt;br /&gt;try &lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;...//code that encounters an exception&lt;br /&gt;}&lt;br /&gt;catch (Exception ex)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;...//exception handling code&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;throw ex; //raise the exception again&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The disadvantage in this way is that the original context of the exception is lost. There is no longer a meaningful call stack attached to the exception because it will contain the latest context from the newly added throw. If you plan to throw the exception in this matter you should wrap the original exception into another new more high level (application) exception. The new exception would add more high level info about the original exception.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The second option is to use the throw keyword alone with out passing the actual exception variable. This tells the .NET framework to throw the original exception without updating its context like below:&lt;br /&gt;&lt;pre class="code"&gt;&lt;br /&gt;try &lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;...//code that encounters an exception&lt;br /&gt;}&lt;br /&gt;catch (Exception e)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;...//exception handling code&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;throw; //notice the exception e is omitted&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This way should be used when the exception is trivial enough and the code is too small to require wrapping into another exception. Again the advantage here is that you maintain the original call stack so that any user of this code can track the cause of the exception.&lt;br /&gt;&lt;br /&gt;It's worth noting that Java is different in this aspect and using "throw ex" in Java will retain the original stack trace.&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1139322805879086422-1270506019018708911?l=dotnetaffairs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetaffairs.blogspot.com/feeds/1270506019018708911/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1139322805879086422&amp;postID=1270506019018708911' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/1270506019018708911'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/1270506019018708911'/><link rel='alternate' type='text/html' href='http://dotnetaffairs.blogspot.com/2011/09/throw-vs-throw-ex-c-net-exceptions.html' title='throw vs throw ex: C# .NET Exceptions'/><author><name>T Alrahem</name><uri>http://www.blogger.com/profile/09938150493349755377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1139322805879086422.post-8341758837834912314</id><published>2011-01-02T11:14:00.000-08:00</published><updated>2011-04-19T18:53:06.250-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows phone 7'/><category scheme='http://www.blogger.com/atom/ns#' term='nearby'/><category scheme='http://www.blogger.com/atom/ns#' term='maps'/><category scheme='http://www.blogger.com/atom/ns#' term='application'/><category scheme='http://www.blogger.com/atom/ns#' term='reviews'/><category scheme='http://www.blogger.com/atom/ns#' term='mobile'/><category scheme='http://www.blogger.com/atom/ns#' term='app'/><category scheme='http://www.blogger.com/atom/ns#' term='wp7'/><category scheme='http://www.blogger.com/atom/ns#' term='directions'/><category scheme='http://www.blogger.com/atom/ns#' term='gps'/><category scheme='http://www.blogger.com/atom/ns#' term='phone'/><category scheme='http://www.blogger.com/atom/ns#' term='navigation'/><title type='text'>Nearby Windows Phone 7 Reviews and Maps App</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/-6P-1rc2_Sqw/Ta43rEgzAOI/AAAAAAAACOU/ClNHqkYTtnA/s1600/nearby_logo_name.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 188px; height: 200px;" src="http://4.bp.blogspot.com/-6P-1rc2_Sqw/Ta43rEgzAOI/AAAAAAAACOU/ClNHqkYTtnA/s200/nearby_logo_name.jpg" alt="" id="BLOGGER_PHOTO_ID_5597472599953309922" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Nearby is a new Windows Phone 7 (WP7) app. The app can be &lt;a href="http://social.zune.net/redirect?type=phoneApp&amp;amp;id=0021a908-7ff6-df11-9264-00237de2db9e"&gt;downloaded here&lt;/a&gt; from the Windows Phone 7 app store.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://social.zune.net/redirect?type=phoneApp&amp;amp;id=0021a908-7ff6-df11-9264-00237de2db9e"&gt;&lt;br /&gt;&lt;/a&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://social.zune.net/redirect?type=phoneApp&amp;amp;id=0021a908-7ff6-df11-9264-00237de2db9e"&gt;&lt;img style="margin-right:auto;margin-left:auto;" src="https://8573080312929466651-a-1802744773732722657-s-sites.googlegroups.com/site/sitepictures/WP7_App_Download.png" alt="Download Now for Windows Phone 7" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://8573080312929466651-a-1802744773732722657-s-sites.googlegroups.com/site/sitepictures/screenshot_nearby_p.png" alt="Nearby nearby screenshot" /&gt;&lt;br /&gt;&lt;br /&gt;Nearby shows the user nearby places automatically upon opening. The user can scroll through the list of nearby places and find more information on a location he is interested in. Information for a location includes phone, address, website, rating, and distance. You can see the directories where the location is found such as Yelp, Yahoo and CitySearch. Using Nearby, you can view the location's page on Yelp and other sources within the app. Browsing to the Yelp or Yahoo page for the business allows you to see reviews and more info.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://8573080312929466651-a-1802744773732722657-s-sites.googlegroups.com/site/sitepictures/screenshot_maps2_p.png" alt="Nearby directions screenshot" /&gt;&lt;br /&gt;&lt;br /&gt;With Nearby, you can find step-by-step directions to the location you are interested in. You can also navigate through the itinerary steps and see the steps on the map.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://8573080312929466651-a-1802744773732722657-s-sites.googlegroups.com/site/sitepictures/screenshot_details2_p.png" alt="Nearby details screenshot" /&gt;&lt;br /&gt;&lt;br /&gt;Nearby allows you to bookmark your favorite locations so that you can find them easily. You may also share a location with a friend via SMS text or email. Calling a place is as easy as touching the phone icon or phone number after selecting a business.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://8573080312929466651-a-1802744773732722657-s-sites.googlegroups.com/site/sitepictures/dark_favorites_screenshot.png" alt="Nearby favorites screenshot" width="325" height="600" /&gt;&lt;br /&gt;&lt;br /&gt;List of favorite places and businesses for easy access.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Find out more about Nearby at &lt;a href="http://www.challengesolutions.net"&gt;http://www.challengesolutions.net&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1139322805879086422-8341758837834912314?l=dotnetaffairs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetaffairs.blogspot.com/feeds/8341758837834912314/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1139322805879086422&amp;postID=8341758837834912314' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/8341758837834912314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/8341758837834912314'/><link rel='alternate' type='text/html' href='http://dotnetaffairs.blogspot.com/2011/01/nearby-windows-phone-7-reviews-and-maps.html' title='Nearby Windows Phone 7 Reviews and Maps App'/><author><name>T Alrahem</name><uri>http://www.blogger.com/profile/09938150493349755377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-6P-1rc2_Sqw/Ta43rEgzAOI/AAAAAAAACOU/ClNHqkYTtnA/s72-c/nearby_logo_name.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1139322805879086422.post-6126998276163856344</id><published>2010-10-15T21:34:00.000-07:00</published><updated>2011-09-15T15:45:03.016-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='app'/><category scheme='http://www.blogger.com/atom/ns#' term='just draw'/><category scheme='http://www.blogger.com/atom/ns#' term='iPhone'/><category scheme='http://www.blogger.com/atom/ns#' term='iPad'/><category scheme='http://www.blogger.com/atom/ns#' term='iDraw n Paint'/><category scheme='http://www.blogger.com/atom/ns#' term='draw'/><category scheme='http://www.blogger.com/atom/ns#' term='sketch'/><category scheme='http://www.blogger.com/atom/ns#' term='App Store'/><category scheme='http://www.blogger.com/atom/ns#' term='iOS'/><category scheme='http://www.blogger.com/atom/ns#' term='Apple'/><category scheme='http://www.blogger.com/atom/ns#' term='multi-touch'/><title type='text'>Just Draw - Drawing App for iPad</title><content type='html'>&lt;a href="http://itunes.apple.com/us/app/just-draw/id393217447?ls=1"&gt;&lt;img alt="Available on the App Store" src="https://sites.google.com/site/fileshub/blogfiles/available_on_appstore.png" width="300" height="100" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Just Draw is the latest mobile app I launched on the Apple App Store. Currently it's only compatible with the iPad. Future versions might extend support to iPhone and iTouch depending on demand.&lt;br /&gt;&lt;br /&gt;Just Draw is a nice simple app that allows iPad users to use their fingers to draw then save or share their drawings via Facebook, Twitter, or email. The app is useful if you want to jot down ideas while thinking then come back to them later. It's also good for quickly mocking up designs of anything. If you ever wanted to quickly write or draw something on a picture and then send it to a friend, Just Draw is the app you've been looking for.&lt;br /&gt;&lt;br /&gt;Perhaps one of the unique features of Just Draw is the "replay" feature. You can have the app trace every move you make by hitting the replay button. So you can take your time and draw something creative then hit replay and watch the app animate your drawing by repeating everything you did.&lt;br /&gt;&lt;br /&gt;The cool thing about this app is that it is built on top of OpenGL which gives it the smooth performance. Just Draw supports multi-touch drawing. So you and your friends can draw at the same time! The app makes use of a few API's such as Facebook and TwitPhoto.&lt;br /&gt;&lt;br /&gt;Since this is the first release, there are many nice features that can be added to Just Draw. I am open to any ideas or suggestions on what users want to add to the app. Have fun with the app and I look forward to hearing your feedback and comments.&lt;br /&gt;&lt;br /&gt;Here are some screenshots from Just Draw:&lt;br /&gt;&lt;br /&gt;&lt;img src="https://4634464917979961544-a-1802744773732722657-s-sites.googlegroups.com/site/fileshub/mzl.hvwbrabh.480x480-75.jpg" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://4634464917979961544-a-1802744773732722657-s-sites.googlegroups.com/site/fileshub/mzl.cxkfjxsv.480x480-75.jpg" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://4634464917979961544-a-1802744773732722657-s-sites.googlegroups.com/site/fileshub/mzl.zxakjhni.480x480-75.jpg" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1139322805879086422-6126998276163856344?l=dotnetaffairs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetaffairs.blogspot.com/feeds/6126998276163856344/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1139322805879086422&amp;postID=6126998276163856344' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/6126998276163856344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/6126998276163856344'/><link rel='alternate' type='text/html' href='http://dotnetaffairs.blogspot.com/2010/10/idraw-n-paint-drawing-app-for-ipad.html' title='Just Draw - Drawing App for iPad'/><author><name>T Alrahem</name><uri>http://www.blogger.com/profile/09938150493349755377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1139322805879086422.post-6507570229384712214</id><published>2010-01-10T15:33:00.000-08:00</published><updated>2011-09-15T15:46:55.370-07:00</updated><title type='text'>iPhone Project Management with TA Project</title><content type='html'>&lt;a href="http://itunes.apple.com/us/app/id347420702"&gt;&lt;img src="http://sites.google.com/site/fileshub/blogfiles/available_on_appstore.png" alt="available on the iphone app store" width="300" height="100"/&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;I just finished developing an iPhone App called TA Project that's on the Apple App Store now. The mobile application allows a user to create tasks or to do lists for a project. It can be simply used for task management. But it can also be used for more complex budget and schedule tracking. TA Project can also compute project management metrics such as the Schedule Performance Index (SPI) and the Cost Performance Index (CPI).&lt;/p&gt;&lt;br /&gt;&lt;p&gt;You can also graph your estimate and actual cost to visually compare your performance to what you have estimated. The graph is useful to foresee whether your actual cost is going to exceed your estimate or not. Another feature of TA Project is allowing the user to post the status of a project on Twitter. One of the tabs for each project is a Twitter tab that allows reading previous posts and posting new Tweets.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;I was the only developer working on the project. I used CorePlot for graphing. Overall the most complex pieces of the project were handling task dependencies, graph formatting, and making the application robust. Making the application robust includes memory management and handling network events. Integrating with Twitter was fairly simple. The app uses CoreData for data storage which uses SQLite underneath.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Xcode and CoreData make using SQLite very convenient. After getting the data model down in Xcode, most of the data pluming is done for you under the hood. This project presented some data challenges because almost every single action the user makes has to be retained.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;Below are some screenshots from the app.&lt;br /&gt;&lt;img src="http://sites.google.com/site/fileshub/blogfiles/myprojects.png" alt="my projects screenshot"&gt;&lt;/img&gt;&lt;br /&gt;Home page screen. This screen shows the list of projects.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;img src="http://sites.google.com/site/fileshub/blogfiles/taskstab.png" alt="tasks screenshot" /&gt;&lt;br /&gt;The Tasks tab. After selecting a project you come to this tab which shows the tasks for the selected project.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;img src="http://sites.google.com/site/fileshub/blogfiles/performancetab.png" alt="performance screenshot" /&gt;&lt;br /&gt;The Performance tab. The Performance tab shows the CPI and SPI metrics in addition to the estimate and actual cost graphs.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;div style="width:490; overflow:scroll;"&gt;&lt;br /&gt;&lt;img src="http://sites.google.com/site/fileshub/blogfiles/landscapegraph.png" alt="landscape graph" /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Flipping the phone shows the graph in landscape mode.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;img src="http://sites.google.com/site/fileshub/blogfiles/twittertab.png" alt="twitter tab screenshot" /&gt;&lt;br /&gt;The Twitter tab. This tab allows the user to read posts and update the status of the project on Twitter.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1139322805879086422-6507570229384712214?l=dotnetaffairs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetaffairs.blogspot.com/feeds/6507570229384712214/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1139322805879086422&amp;postID=6507570229384712214' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/6507570229384712214'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/6507570229384712214'/><link rel='alternate' type='text/html' href='http://dotnetaffairs.blogspot.com/2010/01/iphone-project-mangement-with-ta.html' title='iPhone Project Management with TA Project'/><author><name>T Alrahem</name><uri>http://www.blogger.com/profile/09938150493349755377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1139322805879086422.post-4371915690929126731</id><published>2009-08-10T01:50:00.000-07:00</published><updated>2009-11-18T22:24:03.176-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='default value'/><category scheme='http://www.blogger.com/atom/ns#' term='sql server'/><category scheme='http://www.blogger.com/atom/ns#' term='non-constant'/><category scheme='http://www.blogger.com/atom/ns#' term='null'/><category scheme='http://www.blogger.com/atom/ns#' term='parameter'/><category scheme='http://www.blogger.com/atom/ns#' term='stored procedure'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft'/><title type='text'>SQL Server SP Parameter Default Value</title><content type='html'>SQL Server does not allow creating a stored procedure with parameter default values that are not constant. This can be a problem if you want to give a parameter a default value that is predictable but not constant such as giving a datetime parameter a default value of the current time.&lt;br /&gt;&lt;br /&gt;There are two ways to resolve this. One is solution but it's not very flexible. The other is a workaround but can be used in more situations. First the solution. If the parameter is used as a minimum or maximum value check, you can totally ignore the value if it's null.&lt;br /&gt;&lt;br /&gt;Here is an example of the first solution. Let's say we want to write a stored procedure to get all records from an Activity table that occured from one point in time to another. In this case we want to include all records if the boundry variable is not specified. In the example below we simply do this by checking for NULL and using the logical OR.&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;br /&gt;CREATE PROCEDURE GetActivityRecords&lt;br /&gt;@From DATETIME&lt;br /&gt;@TO DATETIME&lt;br /&gt;&lt;br /&gt;AS&lt;br /&gt;&amp;nbsp;BEGIN&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;SELECT * FROM Activity&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;WHERE (@From is null or LogTime &gt;= @From)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;and (@To is null or LogTime &lt;= @To)&lt;br /&gt;&amp;nbsp;END&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Another way to do this that is more flexible is to check if the parameter is null and in that case set it equal to whatever value you wish.&lt;br /&gt;&lt;br /&gt;For example, in the code below I check if the @To variable is null and if it is I set it equal to the current time.&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;br /&gt;CREATE PROCEDURE GetActivityRecords&lt;br /&gt;@From DATETIME&lt;br /&gt;@TO DATETIME&lt;br /&gt;&lt;br /&gt;AS&lt;br /&gt;&amp;nbsp;BEGIN&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;IF @To is null&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;BEGIN&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SET @To = GetDate()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;END&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;SELECT * FROM Activity&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;WHERE (@From is null or LogTime &gt;= @From)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;and LogTime &lt;= @To&lt;br /&gt;&amp;nbsp;END&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1139322805879086422-4371915690929126731?l=dotnetaffairs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetaffairs.blogspot.com/feeds/4371915690929126731/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1139322805879086422&amp;postID=4371915690929126731' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/4371915690929126731'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/4371915690929126731'/><link rel='alternate' type='text/html' href='http://dotnetaffairs.blogspot.com/2009/08/sql-server-sp-parameter-default-value.html' title='SQL Server SP Parameter Default Value'/><author><name>T Alrahem</name><uri>http://www.blogger.com/profile/09938150493349755377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1139322805879086422.post-335056515564456636</id><published>2009-03-29T22:36:00.000-07:00</published><updated>2009-03-29T22:58:42.058-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='access modifiers'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><category scheme='http://www.blogger.com/atom/ns#' term='default access modifiers'/><title type='text'>C# .NET Default Access Modifiers</title><content type='html'>It's good to refresh what the default access modifiers are in C#. Default access modifiers could explain why you can't see something you declared when expect to see it and vice versa.&lt;br /&gt;&lt;br /&gt;First let's quickly review all the access modifiers in C#.&lt;br /&gt;&lt;b style="color: blue"&gt;private&lt;/b&gt;: Can be accessed by members of the same class only.&lt;br /&gt;&lt;b style="color: blue"&gt;protected&lt;/b&gt;: Can be accessed by members of the same class plus members of derived classes only.&lt;br /&gt;&lt;b style="color: blue"&gt;internal&lt;/b&gt;: Can be accessed by all that is in the same assembly regardless of what class they are in. But can only be accessed from the same assembly.&lt;br /&gt;&lt;b style="color: blue"&gt;public&lt;/b&gt;: Can be accessed by everything.&lt;br /&gt;&lt;br /&gt;The general rule is that the default access modifier is as secured as possible for the declaration context. This does not mean that everything is &lt;b style="color: blue"&gt;private&lt;/b&gt; by default because &lt;b style="color: blue"&gt;private&lt;/b&gt; does not make sense for everything. So here is the breakdown.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Data types: class, struct, enum&lt;/b&gt;&lt;br /&gt;For data types such as classes the most strict reasonable access modifier is &lt;b style="color: blue"&gt;internal&lt;/b&gt;. And that is exactly the default modifier. So when declaring a new class it is &lt;b style="color: blue"&gt;internal&lt;/b&gt; by default so that it can be accessed by other classes in the same assembly. It does not make sense for a class to be &lt;b style="color: blue"&gt;private&lt;/b&gt; by default because it would inaccessible.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Members: variables, methods&lt;/b&gt;&lt;br /&gt;For member variables and methods which are inside a certain data type from the list above, the most restrictive reasonable modifier is &lt;b style="color: blue"&gt;private&lt;/b&gt; and that is it. Any time a member is declared with no access modifier, it is &lt;b style="color: blue"&gt;private&lt;/b&gt; by default.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1139322805879086422-335056515564456636?l=dotnetaffairs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetaffairs.blogspot.com/feeds/335056515564456636/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1139322805879086422&amp;postID=335056515564456636' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/335056515564456636'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/335056515564456636'/><link rel='alternate' type='text/html' href='http://dotnetaffairs.blogspot.com/2009/03/c-net-default-access-modifiers.html' title='C# .NET Default Access Modifiers'/><author><name>T Alrahem</name><uri>http://www.blogger.com/profile/09938150493349755377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1139322805879086422.post-99241483125830228</id><published>2009-03-16T00:38:00.000-07:00</published><updated>2009-03-29T22:58:02.741-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='asp .net tags'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><category scheme='http://www.blogger.com/atom/ns#' term='asp .net'/><title type='text'>Inline ASP.NET Tags Differences &lt;%#, &lt;%, &lt;%=, &lt;%$, &lt;%--, &lt;%@</title><content type='html'>It gets confusing at times when figuring out which ASP.NET tag is best to use. Moreover, it is good to know the settle difference between a couple of the similar tags. One might think that for example the "&amp;lt;%#" tag and "&amp;lt;%=" are the same for certain cases and can be used interchangeably. Actually they are different and in most cases only one of them would work unless some code change is done. So here is a summary of the tag attributes and the differences amongst them:&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;h3&gt;&amp;lt;% ... %&amp;gt;&lt;/h3&gt;&lt;/center&gt;&lt;br /&gt;This tag is used to insert code into an ASP.NET page usually with a .aspx extension. One of the most common use of this tag is conditional statements where you can choose to display certain content only when a condition is met.&lt;br /&gt;&lt;pre class="code"&gt;&lt;br /&gt;&amp;lt;% if(isLoggedIn){ %&amp;gt;&lt;br /&gt;   Hello user&lt;br /&gt;&amp;lt;% } else { %&amp;gt;&lt;br /&gt;   Please login&lt;br /&gt;&amp;lt;% } %&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;For more info:&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms178135(vs.80).aspx"&gt;http://msdn.microsoft.com/en-us/library/ms178135(vs.80).aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;h3&gt;&lt;b&gt;&amp;lt;%# ... %&amp;gt;&lt;/b&gt;&lt;/h3&gt;&lt;/center&gt;&lt;br /&gt;This tag is used with data binding. It can be used with DataBinder.Eval() or DataBinder.Bind() or just with any protected or public member as shown in the example. The trick about this tag is that it must be used inside a server-side element (with runat="server"). Also the DataBind() method of that element must be called at some point. However, certain ASP.NET elements automatically call their DataBind() method in their PreRender() methods. So there is no need to is explicitly call their DataBind() methods. Such elements are GridView, DetailsView, and FormView.&lt;br /&gt;&lt;pre class="code"&gt;&lt;br /&gt;&amp;lt;div id="div1" runat="server"&amp;gt;&lt;br /&gt;   Hello &amp;lt;%# userName %&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;In the code behind:&lt;br /&gt;&lt;pre class="code"&gt;&lt;br /&gt;protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;   div1.DataBind();&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;For more info:&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms178366.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms178366.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;h3&gt;&lt;b&gt;&amp;lt;%= ... %&amp;gt;&lt;/b&gt;&lt;/h3&gt;&lt;/center&gt;&lt;br /&gt;This tag is similar to the above tag in the sense that it is used to evaluate the value of a protected or public member variable. The tag evaluates the ToString() method of the variable used and displays it. The nice thing about this tag is that it does not need to be inside a server-side element and its parent element does not even need to have a name.&lt;br /&gt;&lt;pre class="code"&gt;&lt;br /&gt;&amp;lt;div&amp;gt;&lt;br /&gt;   Hello &amp;lt;%= userName %&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;For more info:&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/6dwsdcf5(VS.71).aspx"&gt;http://msdn.microsoft.com/en-us/library/6dwsdcf5(VS.71).aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;h3&gt;&lt;b&gt;&amp;lt;%$ ... %&amp;gt;&lt;/b&gt;&lt;/h3&gt;&lt;/center&gt;&lt;br /&gt;This tag is used to evaluate expressions in a configuration file. It is usually used for connection strings but it can be used with AppSettings and other configurations.&lt;br /&gt;&lt;pre class="code"&gt;&lt;br /&gt;&amp;lt;asp:SqlDataSource ID="SqlDataSource1" Runat="server" &lt;br /&gt;    SelectCommand="SELECT * FROM [Employees]"&lt;br /&gt;    ConnectionString="&amp;lt;%$ ConnectionStrings:NorthwindConnectionString1 %&amp;gt;"&amp;gt;&lt;br /&gt;&amp;lt;/asp:SqlDataSource&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;For more info:&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/d5bd1tad.aspx"&gt;http://msdn.microsoft.com/en-us/library/d5bd1tad.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;h3&gt;&lt;b&gt;&amp;lt;%@ ... %&amp;gt;&lt;/b&gt;&lt;/h3&gt;&lt;/center&gt;&lt;br /&gt;This is usually used at top of a page as a directive to register controls or import a library.&lt;br /&gt;&lt;pre class="code"&gt;&lt;br /&gt;&amp;lt;%@ Register TagPrefix="uc" Namespace="MyCustomUserControl" %&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;For more info:&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/xz702w3e(VS.80).aspx"&gt;http://msdn.microsoft.com/en-us/library/xz702w3e(VS.80).aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;h3&gt;&lt;b&gt;&amp;lt;%-- ... --%&amp;gt;&lt;/b&gt;&lt;/h3&gt;&lt;/center&gt;&lt;br /&gt;This tag allows you to add server-side comments which would never show in the HTML output. This is different from using an HTML comment (&amp;lt;! --&amp;gt;) because HTML comments do get rendered in the outputted HTML.&lt;br /&gt;&lt;pre class="code"&gt;&lt;br /&gt;&amp;lt;%-- this is a comment --%&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;For more info:&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/4acf8afk.aspx"&gt;http://msdn.microsoft.com/en-us/library/4acf8afk.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;That should be a good summary but there is obviously more to some of tags.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1139322805879086422-99241483125830228?l=dotnetaffairs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetaffairs.blogspot.com/feeds/99241483125830228/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1139322805879086422&amp;postID=99241483125830228' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/99241483125830228'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/99241483125830228'/><link rel='alternate' type='text/html' href='http://dotnetaffairs.blogspot.com/2009/03/inline-aspnet-tags-differences.html' title='Inline ASP.NET Tags Differences &amp;lt;%#, &amp;lt;%, &amp;lt;%=, &amp;lt;%$, &amp;lt;%--, &amp;lt;%@'/><author><name>T Alrahem</name><uri>http://www.blogger.com/profile/09938150493349755377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1139322805879086422.post-4195794825909818133</id><published>2008-11-07T21:19:00.000-08:00</published><updated>2008-11-07T22:02:33.784-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='web.config'/><category scheme='http://www.blogger.com/atom/ns#' term='connection string'/><category scheme='http://www.blogger.com/atom/ns#' term='sql server'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><category scheme='http://www.blogger.com/atom/ns#' term='sqldatasource'/><category scheme='http://www.blogger.com/atom/ns#' term='database'/><category scheme='http://www.blogger.com/atom/ns#' term='asp .net'/><title type='text'>ASP .NET Connection Strings in Web.config File</title><content type='html'>ASP .NET offers an elegant way to store data source connection creditentials. Connection strings should be stored in a .config file, commonly and by default the Web.config file.&lt;br /&gt; &lt;br /&gt;Firstly, what are connection strings? Connection strings are strings of text that contain information about a data source used in the code for data access. Information contained in a connection string includes the data source name, data source address, security mode, login creditentials, and the data source type.&lt;br /&gt;&lt;br /&gt;There are a couple reasons why the Web.config file is a good place to store connection. One, ASP .NET is automatically configured to never display a file with a .config extension. So you can assume a level of security when storing login information in the Web.config. In addition, ASP .NET can be configured to encrypt the Web.config file, which would add more security. Nonetheless, you can be assured that any web request to a .config file would result in an error. Secondly, using Web.config allows a central way to manage information without requiring digging into the code nor code modification.&lt;br /&gt;&lt;br /&gt;Below are examples of how connection strings would be used:&lt;br /&gt;&lt;pre class="code"&gt;&lt;br /&gt;&amp;lt;?xml version="1.0"?&amp;gt;&lt;br /&gt;&amp;lt;configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;connectionStrings&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;add name="connectionName" connectionString="Data Source=serverName;&lt;br /&gt;&amp;nbsp;&amp;nbsp;Initial Catalog=databaseName;User Id=username;Password=password;"&lt;br /&gt;&amp;nbsp;&amp;nbsp;providerName="System.Data.SqlClient"/&amp;gt;&lt;br /&gt;&amp;lt;/connectionStrings&amp;gt;&lt;br /&gt;...&lt;br /&gt;&amp;lt;/configuration&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;To retrieve the above connection string in C# code:&lt;br /&gt;&lt;pre class="code"&gt;&lt;br /&gt;string connStr = ConfigurationManager.ConnectionStrings["connectionName"];&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;To use the connection string directly in an ASP .NET page:&lt;br /&gt;&lt;pre class="code"&gt;&lt;br /&gt;&amp;lt;asp:SqlDataSource ID="SqlDataSource1" runat="server"&lt;br /&gt;&amp;nbsp;&amp;nbsp;ConnectionString="&amp;lt;%$ ConnectionStrings:connectionName %&amp;gt;"&lt;br /&gt;&amp;nbsp;&amp;nbsp;SelectCommand="SELECT * FROM [Employees]" /&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1139322805879086422-4195794825909818133?l=dotnetaffairs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetaffairs.blogspot.com/feeds/4195794825909818133/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1139322805879086422&amp;postID=4195794825909818133' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/4195794825909818133'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/4195794825909818133'/><link rel='alternate' type='text/html' href='http://dotnetaffairs.blogspot.com/2008/11/asp-net-connection-strings-in-webconfig.html' title='ASP .NET Connection Strings in Web.config File'/><author><name>T Alrahem</name><uri>http://www.blogger.com/profile/09938150493349755377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1139322805879086422.post-6765737158593994396</id><published>2008-11-06T19:07:00.000-08:00</published><updated>2008-11-07T21:25:28.366-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='datareader'/><category scheme='http://www.blogger.com/atom/ns#' term='data'/><category scheme='http://www.blogger.com/atom/ns#' term='ado .net'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='dataset'/><category scheme='http://www.blogger.com/atom/ns#' term='database'/><title type='text'>Reading/Writing Data with ADO .NET in C#</title><content type='html'>In .NET coding there are two main methods of handling database data using ADO.NET. The two methods are distinguished by the classes used to access and manipulate the data. The classes are DataReader and DataSet. I will briefly go over each class and major differences between the two in addition to some examples.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;DataReader&lt;/h2&gt;&lt;br /&gt;The DataReader is the core class for retrieving data from a database in ADO.NET. When using ADO.NET to read data from a database, a DataReader is always used although sometimes implicitly. Even in the case of using a DataSet, the DataAdapter that is used to populate the DataSet uses a DataReader internally. &lt;br /&gt;Now a few things about the DataReader. A DataReader object can merely provide read-only access to a database and only in a forward direction. The DataReader is connection based, meaning the connection to database is maintained while data is read by the DataReader. The DataReader class is efficient and has a relatively small memory fingerprint. If no data writing is required, a DataReader is usually the best choice.&lt;br /&gt;&lt;h3&gt;Example&lt;/h3&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;br /&gt;using (SqlConnection conn = new SqlConnection(connectionString))&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;SqlCommand command = new SqlCommand("SELECT * FROM Categories");&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;command.Connection = conn;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;conn.Open();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;SqlDataReader dr = command.ExecuteReader();&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;DataSet&lt;/h2&gt;&lt;br /&gt;As we have seen above, the DataSet aproach also uses a DataReader. However, the difference is that the DataReader is used to read the data into a DataSet object which retains the data in memory. Once in memory, the data can be manipulated as the programmer wishes. After the data is modified inside the DataSet, it can be written back to a database. &lt;br /&gt;The DataSet is a connectionless object. Once the data is read into the DataSet, the connection to the database is halted. Clearly, using a DataSet to hold records has a memory cost. While in memory, the data can be modified multiple times and when finalized written once to the database. If data memory retention or modification is needed, a DataSet is usually the solution.&lt;br /&gt;&lt;h3&gt;Example&lt;/h3&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;br /&gt;using (SqlConnection conn = new SqlConnection(connectionString))&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;SqlDataAdapter da = new SqlDataAdapter("SELECT * FROM Categories",conn);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;DataSet ds = new DataSet();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;ad.Fill(ds);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1139322805879086422-6765737158593994396?l=dotnetaffairs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetaffairs.blogspot.com/feeds/6765737158593994396/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1139322805879086422&amp;postID=6765737158593994396' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/6765737158593994396'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/6765737158593994396'/><link rel='alternate' type='text/html' href='http://dotnetaffairs.blogspot.com/2008/11/readingwriting-data-with-ado-net-in-c.html' title='Reading/Writing Data with ADO .NET in C#'/><author><name>T Alrahem</name><uri>http://www.blogger.com/profile/09938150493349755377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1139322805879086422.post-8279128314913005286</id><published>2008-09-10T16:47:00.000-07:00</published><updated>2008-09-10T16:58:48.782-07:00</updated><title type='text'>TS 70-630: Microsoft Office SharePoint Server 2007, Application Development</title><content type='html'>Best way to prepare for this exam is by taking one of the available practice tests. One good one I have tried is the practice test from &lt;a href="http://measureup.com"&gt;MeasureUP.com&lt;/a&gt;. One thing I like about the MeasureUP exams that cannot be done with Transcender is that you can review your answer as you go through the questions. You don’t have to wait until the exam is completed. Relative to the WSS 3.0 Application Development exam this exam is not hard to pass. From my experience, the one subject to focus on the most is the Business Data Catalog (BDC). You have to be familiar with BDC Application Definitions. Make sure you understand all the questions about the BDC.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1139322805879086422-8279128314913005286?l=dotnetaffairs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetaffairs.blogspot.com/feeds/8279128314913005286/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1139322805879086422&amp;postID=8279128314913005286' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/8279128314913005286'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/8279128314913005286'/><link rel='alternate' type='text/html' href='http://dotnetaffairs.blogspot.com/2008/09/ts-70-630-microsoft-office-sharepoint.html' title='TS 70-630: Microsoft Office SharePoint Server 2007, Application Development'/><author><name>T Alrahem</name><uri>http://www.blogger.com/profile/09938150493349755377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1139322805879086422.post-7536269302679637867</id><published>2008-07-14T00:27:00.000-07:00</published><updated>2008-07-15T00:21:24.995-07:00</updated><title type='text'>Sharepoint Server and WSS Certificates</title><content type='html'>I have posted &lt;a href="http://dotnetaffairs.blogspot.com/2008/04/microsoft-office-sharepoint-server.html"&gt;before&lt;/a&gt; general Sharepoint resources that are relevant to certain Microsoft certificates. However, in the next few posts I want to talk specifically about four Sharepoint exams that I passed not long ago and give some pointers.&lt;br /&gt;&lt;br /&gt;Before I get into that, I want to mention what happened with the 2 beta exams I was supposed to take and then my testing center &lt;a href="http://dotnetaffairs.blogspot.com/2008/05/asp-net-35-and-ado-net-35-beta-exams.html"&gt;canceled&lt;/a&gt;. Essentially, I ended up getting 2 free exams from Prometric to make up for them. But since the day I was scheduled was the last day for the beta exams I couldn't register for them then. So I took a couple Sharepoint exams instead. Here it is.&lt;br /&gt;&lt;br /&gt;In general, a very good resource for all four exams and especially the Windows Sharepoint Services (WSS) ones is the Inside Microsoft® Windows® SharePoint® Services 3.0 book from the Microsoft Press by Ted Pattison and Daniel Larson. If you have access to &lt;a href="http://books24x7.com"&gt;books24x7.com&lt;/a&gt;, an online version of it is available there. Today I am going to talk about the 70-630 exam.&lt;br /&gt;&lt;a href="http://www.microsoft.com/mspress/books/9692.aspx"&gt;&lt;br /&gt;&lt;img src="http://www.microsoft.com/MSPress/books/imgt/9692.gif" alt="Inside Microsoft® Windows® SharePoint® Services 3.0 book"/&gt;&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;TS 70-630: Microsoft Office SharePoint Server 2007, Configuring&lt;/h4&gt;&lt;br /&gt;The fastest way to learn the material for this exam is to take a practice test and study its answer explanations. The following test providers have practice tests for this exam, &lt;a href="http://www.transcender.com"&gt;Transcender&lt;/a&gt;, &lt;a href="http://www.measureup.com"&gt;MeasureUp&lt;/a&gt;, and &lt;a href="http://www.selftestsoftware.com"&gt;Self Test Software&lt;/a&gt;.&lt;br /&gt;The test should not have any development questions so focus on configuration, things you can do by moving and clicking the mouse around with very little typing. Here are more specific tips:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Familiarize yourself with the administrative console features.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Get familiar with the site and other settings pages.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Know how to do simple settings tasks like adding an item to a menu and changing the site logo.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Understand Groups and Audiences.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Know the basics of using the STSADM and Prescan tools.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Understand the different connection files, UDC and ODC.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Know what Restrictive Read is.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Know how to see the servers running in a web farm and what services they are running.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Understand Quiescing.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;For more information visit the Microsoft &lt;a href="http://www.microsoft.com/learning/en/us/exams/70-630.mspx"&gt;page&lt;/a&gt; for the exam.&lt;br /&gt;&lt;br /&gt;Please leave a comment and let me know what you think!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1139322805879086422-7536269302679637867?l=dotnetaffairs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetaffairs.blogspot.com/feeds/7536269302679637867/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1139322805879086422&amp;postID=7536269302679637867' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/7536269302679637867'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/7536269302679637867'/><link rel='alternate' type='text/html' href='http://dotnetaffairs.blogspot.com/2008/07/sharepoint-server-and-wss-certificates.html' title='Sharepoint Server and WSS Certificates'/><author><name>T Alrahem</name><uri>http://www.blogger.com/profile/09938150493349755377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1139322805879086422.post-2123037404983134575</id><published>2008-06-16T23:47:00.000-07:00</published><updated>2008-06-17T01:21:45.535-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='transparent'/><category scheme='http://www.blogger.com/atom/ns#' term='windowless'/><category scheme='http://www.blogger.com/atom/ns#' term='wmode'/><category scheme='http://www.blogger.com/atom/ns#' term='background'/><category scheme='http://www.blogger.com/atom/ns#' term='flash'/><title type='text'>HTML/Div Layering over Flash and Transparent Background with Windowless Mode</title><content type='html'>To lay HTML elements such as a DIV over a Flash object, the Flash object must be embedded with windowless mode. Setting the mode to windowless also allows the web page to show an image or a background through the Flash object embedded on the page. The only drawback with using windowless mode is performance. Most of the time the difference in performance would not be noticeable. However, if performance was a top concern then alternate designs should be considered.&lt;br /&gt;&lt;br /&gt;To set the mode to windowless or transparent, the "wmode" parameter should be set to "transparent" as follows. The way the mode is changed depends on the browser. On IE the OBJECT tag is used. On Firefox the EMBED tag is used instead. To accommodate for all browsers use &lt;a href="http://blog.deconcept.com/swfobject" title="swfobject"&gt;SWFObject&lt;/a&gt; or put the EMBED tag inside the OBJECT tag right before "&amp;lt;/OBJECT&amp;gt;".&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;&amp;lt;OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"&lt;br /&gt;codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&lt;br /&gt;WIDTH="550" HEIGHT="400" id="objectId"&amp;gt;&lt;br /&gt;&amp;lt;PARAM NAME=movie VALUE="flashfile.swf"&amp;gt;&lt;br /&gt;&amp;lt;PARAM NAME=quality VALUE=high&amp;gt;&lt;br /&gt;&amp;lt;PARAM NAME=bgcolor VALUE=#FFFFFF&amp;gt;&lt;br /&gt;&amp;lt;param name="wmode" value="transparent"&amp;gt;&lt;br /&gt;&amp;lt;/OBJECT&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;&amp;lt;EMBED src="/support/flash/ts/documents/myFlashMovie.swf"&lt;br /&gt;quality=high bgcolor=#FFFFFF WIDTH="550" HEIGHT="400"&lt;br /&gt;NAME="embedId" ALIGN="" TYPE="application/x-shockwave-flash"&lt;br /&gt;PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"&lt;br /&gt;wmode="transparent"&amp;gt;&amp;lt;/EMBED&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Using my favorite way of embedding flash, SWFObject:&lt;br /&gt;&lt;pre class="code"&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;   var so = new SWFObject("flashfile.swf", "objectId", "400", "100%", "8", "#336699");&lt;br /&gt;   so.addParam("quality", "high");&lt;br /&gt;   so.addParam("wmode", "transparent");&lt;br /&gt;   so.write("flashelement");&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;br /&gt;For more information there is a &lt;a href="http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_14201" title="adobe technote"&gt;TechNote&lt;/a&gt; about this from &lt;a href="http://adobe.com" title="adobe"&gt;Adobe&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1139322805879086422-2123037404983134575?l=dotnetaffairs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetaffairs.blogspot.com/feeds/2123037404983134575/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1139322805879086422&amp;postID=2123037404983134575' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/2123037404983134575'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/2123037404983134575'/><link rel='alternate' type='text/html' href='http://dotnetaffairs.blogspot.com/2008/06/htmldiv-layering-over-flash-and.html' title='HTML/Div Layering over Flash and Transparent Background with Windowless Mode'/><author><name>T Alrahem</name><uri>http://www.blogger.com/profile/09938150493349755377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1139322805879086422.post-1661221197157544564</id><published>2008-06-02T00:21:00.000-07:00</published><updated>2008-08-28T17:31:57.190-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='downlevel-revealed'/><category scheme='http://www.blogger.com/atom/ns#' term='downlevel-hidden'/><category scheme='http://www.blogger.com/atom/ns#' term='firefox'/><category scheme='http://www.blogger.com/atom/ns#' term='internet explorer'/><category scheme='http://www.blogger.com/atom/ns#' term='ie'/><category scheme='http://www.blogger.com/atom/ns#' term='conditional comments'/><category scheme='http://www.blogger.com/atom/ns#' term='opera'/><category scheme='http://www.blogger.com/atom/ns#' term='mozilla'/><category scheme='http://www.blogger.com/atom/ns#' term='css'/><title type='text'>Internet Explorer (IE) Conditional Comments</title><content type='html'>It's rather common that the same CSS styles are rendered differently among different browsers. Many times there is a difference between the way Netscape/Mozilla/Firefox browsers interpret CSS code and the way IE does. Opera seems to fall on either side depending on the property. Another problem that often arises is that different Javascript code must be written for different browsers. &lt;br /&gt;&lt;br /&gt;Now with Javascript, unlike CSS, it's easy to check the type of browser and execute different code accordingly as I've explained &lt;a href="http://dotnetaffairs.blogspot.com/2008/03/checking-os-and-browser-with-javascript.html"&gt;before&lt;/a&gt;. However, it's sometimes more desirable to include different Javascript files depending on the browser especially when there is code that is specific to only IE. One viable solution for this is using the IE conditional comments.&lt;br /&gt;&lt;br /&gt;Using IE conditional comments, one can include Javascript, CSS, and HTML that is only parsed if the user browser is IE or if it's not IE. If it is IE, you check even further and include the code if browser is a specific version of IE.&lt;br /&gt;&lt;br /&gt;There are two types of conditional comments. One is called "downlevel-hidden," which is only parsed by IE because it uses special IE syntax. The second is called "downlevel-revealed," which is ignored by IE and parsed by everything else because it's not a standard HTML comment.&lt;br /&gt;&lt;br /&gt;The downlevel-hidden syntax is as follows:&lt;br /&gt;&lt;div class="code"&gt;&amp;lt;!--[if IE]&amp;gt; Javascript/CSS/HTML &amp;lt;![endif]--&amp;gt;&lt;/div&gt;&lt;br /&gt;As you can see the downlevel-hidden syntax uses standard "&amp;lt;!-- ... --&amp;gt;" HTML comment syntax. &lt;br /&gt;&lt;br /&gt;Now the downlevel-revealed syntax is:&lt;br /&gt;&lt;div class="code"&gt;&amp;lt;![if !IE]&amp;gt; Javascript/CSS/HTML &amp;lt;![endif]&amp;gt;&lt;/div&gt;&lt;br /&gt;Here we don't have the two dashes "--" after the "!" and before the "&amp;gt;". &lt;br /&gt;&lt;br /&gt;The difference between downlevel-hidden and downlevel-revealed is that downlevel-hidden is parsed by IE when the condition is true and is never parsed by other browsers. Downlevel-revealed is always parsed by other browsers and is parsed by IE only when the condition is satisfied. So in both cases IE selectively executes but in downlevel-hidden other browsers never see the code and in downlevel-revealed they always parse it.&lt;br /&gt;&lt;br /&gt;Here are some examples of what can be done with conditional comments from &lt;a href="http://msdn.microsoft.com/en-us/library/ms537512.aspx"&gt;MSDN&lt;/a&gt;&lt;br /&gt;&lt;pre class="code"&gt;&amp;lt;!--[if IE]&amp;gt;&amp;lt;p&amp;gt;You are using Internet Explorer.&amp;lt;/p&amp;gt;&amp;lt;![endif]--&amp;gt;&lt;br /&gt;&amp;lt;![if !IE]&amp;gt;&amp;lt;p&amp;gt;You are not using Internet Explorer.&amp;lt;/p&amp;gt;&amp;lt;![endif]&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!--[if IE 7]&amp;gt;&amp;lt;p&amp;gt;Welcome to Internet Explorer 7!&amp;lt;/p&amp;gt;&amp;lt;![endif]--&amp;gt;&lt;br /&gt;&amp;lt;!--[if !(IE 7)]&amp;gt;&amp;lt;p&amp;gt;You are not using version 7.&amp;lt;/p&amp;gt;&amp;lt;![endif]--&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!--[if gte IE 7]&amp;gt;&amp;lt;p&amp;gt;You are using IE 7 or greater.&amp;lt;/p&amp;gt;&amp;lt;![endif]--&amp;gt;&lt;br /&gt;&amp;lt;!--[if (IE 5)]&amp;gt;&amp;lt;p&amp;gt;You are using IE 5 (any version).&amp;lt;/p&amp;gt;&amp;lt;![endif]--&amp;gt;&lt;br /&gt;&amp;lt;!--[if (gte IE 5.5)&amp;amp;(lt IE 7)]&amp;gt;&amp;lt;p&amp;gt;You are using IE 5.5 or IE 6.&amp;lt;/p&amp;gt;&amp;lt;![endif]--&amp;gt;&lt;br /&gt;&amp;lt;!--[if lt IE 5.5]&amp;gt;&amp;lt;p&amp;gt;Please upgrade your version of Internet Explorer.&amp;lt;/p&amp;gt;&amp;lt;![endif]--&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!--[if true]&amp;gt;You are using an &amp;lt;em&amp;gt;uplevel&amp;lt;/em&amp;gt; browser.&amp;lt;![endif]--&amp;gt;&lt;br /&gt;&amp;lt;![if false]&amp;gt;You are using a &amp;lt;em&amp;gt;downlevel&amp;lt;/em&amp;gt; browser.&amp;lt;![endif]&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!--[if true]&amp;gt;&amp;lt;![if IE 7]&amp;gt;&amp;lt;p&amp;gt;This nested comment is displayed in IE 7.&amp;lt;/p&amp;gt;&amp;lt;![endif]&amp;gt;&amp;lt;![endif]--&amp;gt;&lt;/pre&gt;&lt;br /&gt;Some of the CSS differences I've noticed is that the &lt;b&gt;opacity&lt;/b&gt; property has no effect in IE but it works in Firefox and Opera. When &lt;b&gt;word-wrap&lt;/b&gt; property with value of "break-word" is applied to hyperlinks (anchors) in Firefox, it does nothing but it works on IE and Opera.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1139322805879086422-1661221197157544564?l=dotnetaffairs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetaffairs.blogspot.com/feeds/1661221197157544564/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1139322805879086422&amp;postID=1661221197157544564' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/1661221197157544564'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/1661221197157544564'/><link rel='alternate' type='text/html' href='http://dotnetaffairs.blogspot.com/2008/06/internet-explorer-ie-conditional.html' title='Internet Explorer (IE) Conditional Comments'/><author><name>T Alrahem</name><uri>http://www.blogger.com/profile/09938150493349755377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1139322805879086422.post-141417056957619771</id><published>2008-05-24T00:01:00.000-07:00</published><updated>2008-05-24T00:14:59.452-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='anchors'/><category scheme='http://www.blogger.com/atom/ns#' term='cursor: pointer'/><category scheme='http://www.blogger.com/atom/ns#' term='a'/><category scheme='http://www.blogger.com/atom/ns#' term='css'/><title type='text'>Don't Abuse Anchors -- Use CSS</title><content type='html'>Many web developers use anchors "&amp;lt;a...&amp;gt;" to suround texts and images simply to change the cursor. This usually involves setting the href property to "#" and possibly using the onclick event to execute some JavaScript code and then adding "return false;" at the end so that the page doesn't jump to top every time a user clicks the link.&lt;br /&gt;&lt;br /&gt;This might have been the right way to do things at some point. However, after introducing the CSS element "cursor," there is no reason to use all that mess. Simply set the cursor property of the HTML element in question to "pointer" and add the onclick event code to the element itself if needed.&lt;br /&gt;&lt;br /&gt;So for example:&lt;br /&gt;&lt;div class="code"&gt;&lt;br /&gt;.button {&lt;br /&gt;   cursor: pointer;&lt;br /&gt;}&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;This makes code look so much cleaner and it would prevent the URL in the browser from changing to something with an "#" at the end. Moreover, it would also prevent the status of the window shown usually at the bottom of the browser from changing when hovering over the element.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1139322805879086422-141417056957619771?l=dotnetaffairs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetaffairs.blogspot.com/feeds/141417056957619771/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1139322805879086422&amp;postID=141417056957619771' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/141417056957619771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/141417056957619771'/><link rel='alternate' type='text/html' href='http://dotnetaffairs.blogspot.com/2008/05/dont-abuse-anchors-use-css.html' title='Don&apos;t Abuse Anchors -- Use CSS'/><author><name>T Alrahem</name><uri>http://www.blogger.com/profile/09938150493349755377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1139322805879086422.post-114231921879262073</id><published>2008-05-04T11:44:00.000-07:00</published><updated>2008-05-04T14:47:31.056-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='content types'/><category scheme='http://www.blogger.com/atom/ns#' term='document information panels'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft sharepoint office server'/><category scheme='http://www.blogger.com/atom/ns#' term='moss'/><title type='text'>Creating and Customizing Document Information Panels Using MOSS 2007</title><content type='html'>&lt;p&gt;Part 1:&lt;/p&gt;&lt;br /&gt;&lt;object width="425" height="350"&gt; &lt;param name="movie" value="http://www.youtube.com/v/cSc2wMlyr9U"&gt; &lt;/param&gt; &lt;embed src="http://www.youtube.com/v/cSc2wMlyr9U" type="application/x-shockwave-flash" width="425" height="350"&gt; &lt;/embed&gt; &lt;/object&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Part 2:&lt;/p&gt;&lt;br /&gt;&lt;object width="425" height="350"&gt; &lt;param name="movie" value="http://www.youtube.com/v/G2SGONQ2tvI"&gt; &lt;/param&gt; &lt;embed src="http://www.youtube.com/v/G2SGONQ2tvI" type="application/x-shockwave-flash" width="425" height="350"&gt; &lt;/embed&gt; &lt;/object&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;This video does a good job of showing how Document Information Panels integrates with Office 2007 applications. Ted demonstrates creating custom content types and using Document Information Panels with InfoPath 2007 to add custom metadata to Office files.&lt;br /&gt;The video is courtesy of Ted Pattison of &lt;a href='http://www.tedpattison.net'&gt;www.tedpattison.net&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1139322805879086422-114231921879262073?l=dotnetaffairs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetaffairs.blogspot.com/feeds/114231921879262073/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1139322805879086422&amp;postID=114231921879262073' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/114231921879262073'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/114231921879262073'/><link rel='alternate' type='text/html' href='http://dotnetaffairs.blogspot.com/2008/05/this-video-does-good-job-of-showing-how.html' title='Creating and Customizing Document Information Panels Using MOSS 2007'/><author><name>T Alrahem</name><uri>http://www.blogger.com/profile/09938150493349755377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1139322805879086422.post-279276422073705076</id><published>2008-05-04T09:32:00.000-07:00</published><updated>2008-05-04T11:49:03.520-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='prometric'/><category scheme='http://www.blogger.com/atom/ns#' term='beta exams'/><category scheme='http://www.blogger.com/atom/ns#' term='asp .net 3.5'/><category scheme='http://www.blogger.com/atom/ns#' term='ado .net 3.5'/><title type='text'>ASP .NET 3.5 and ADO .NET 3.5 Beta Exams Canceled</title><content type='html'>&lt;p&gt;&lt;br /&gt;I just got off the phone with the manager of the Prometric testing center I usually go to to cancel both of my beta exams scheduled for today. He said he had an emergency and has to close the center by 10am to go pick up some people from LAX airport. The people he's receiving were supposed to come on Monday but for some reason came a day early. &lt;br /&gt;&lt;br /&gt;I don't really care but I am curious if I can actually reschedule them. He gave me a ticket number to use to reschedule and said that I would be able to reschedule them even though today was the last day to take them. I think he didn't know what he was talking about but it's worth trying. I am going to call tomorrow and see what happens. Anyway today was the last day to take the beta ASP .NET 3.5 70-562 and the ADO .NET 3.5 70-561 exams.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1139322805879086422-279276422073705076?l=dotnetaffairs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetaffairs.blogspot.com/feeds/279276422073705076/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1139322805879086422&amp;postID=279276422073705076' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/279276422073705076'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/279276422073705076'/><link rel='alternate' type='text/html' href='http://dotnetaffairs.blogspot.com/2008/05/asp-net-35-and-ado-net-35-beta-exams.html' title='ASP .NET 3.5 and ADO .NET 3.5 Beta Exams Canceled'/><author><name>T Alrahem</name><uri>http://www.blogger.com/profile/09938150493349755377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1139322805879086422.post-452391569414588398</id><published>2008-04-12T23:50:00.000-07:00</published><updated>2008-04-13T00:28:53.505-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='conserve energy'/><category scheme='http://www.blogger.com/atom/ns#' term='google in black'/><category scheme='http://www.blogger.com/atom/ns#' term='earth hour'/><category scheme='http://www.blogger.com/atom/ns#' term='make google black'/><category scheme='http://www.blogger.com/atom/ns#' term='blackle'/><category scheme='http://www.blogger.com/atom/ns#' term='google'/><title type='text'>Blackle - Make Google Black</title><content type='html'>&lt;a href="http://google.com/"&gt;Google&lt;/a&gt; recently dimmed its lights &lt;a href="http://blog.wired.com/underwire/2008/03/google-goes-bla.html"&gt;observing the Earth Hour&lt;/a&gt;. Whether using a black background conserves energy or not is debatable and depends on the type of monitor that is used. One attempt at saving energy by dimming the background on one of the most popular pages online is &lt;a href="http://blackle.com/"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;Blackle&lt;/span&gt;&lt;/a&gt;. &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;Blackle&lt;/span&gt; was developed by &lt;a href="http://www.heapmedia.com/"&gt;Heap Media&lt;/a&gt;, a company based in Sydney, Australia and &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_2"&gt;founded&lt;/span&gt; in 2005. Heap Media "is committed to developing and growing leading online services with global reach."&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blackle.com/"&gt;Search Google in Black&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.blackle.com/"&gt;www.blackle.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1139322805879086422-452391569414588398?l=dotnetaffairs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='enclosure' type='' href='http://blackle.com' length='0'/><link rel='replies' type='application/atom+xml' href='http://dotnetaffairs.blogspot.com/feeds/452391569414588398/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1139322805879086422&amp;postID=452391569414588398' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/452391569414588398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/452391569414588398'/><link rel='alternate' type='text/html' href='http://dotnetaffairs.blogspot.com/2008/04/blackle-make-google-black.html' title='Blackle - Make Google Black'/><author><name>T Alrahem</name><uri>http://www.blogger.com/profile/09938150493349755377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1139322805879086422.post-5319645971580860830</id><published>2008-04-09T23:24:00.000-07:00</published><updated>2008-04-13T00:24:37.091-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='resources'/><category scheme='http://www.blogger.com/atom/ns#' term='sharepoint server'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft sharepoint office server'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft'/><category scheme='http://www.blogger.com/atom/ns#' term='moss'/><category scheme='http://www.blogger.com/atom/ns#' term='free online training'/><title type='text'>Microsoft Office Sharepoint Server Resources</title><content type='html'>&lt;p&gt;&lt;br /&gt;I was looking online for Sharepoint information and training material and here are some excellent resources I found:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Free Sharepoint 2007 Server Courses by Microsoft&lt;br /&gt;&lt;a href="http://office.microsoft.com/en-us/training/CR102146081033.aspx"&gt;http://office.microsoft.com/en-us/training/CR102146081033.aspx&lt;/a&gt;&lt;br /&gt;Some of these course are very basic and are meant for general users not developers. For example, some of them teach the user how to upload or save a file directly from Word/Excel/Powerpoint to a Sharepoint server.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;Sharepoint desktop training download.&lt;br /&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=7BB3A2A3-6A9F-49F4-84E8-FF3FB71046DF&amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyId=7BB3A2A3-6A9F-49F4-84E8-FF3FB71046DF&amp;displaylang=en&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;Sharepoint standalone and server training download&lt;br /&gt;&lt;a href="http://office.microsoft.com/en-us/sharepointserver/HA102488011033.aspx"&gt;http://office.microsoft.com/en-us/sharepointserver/HA102488011033.aspx&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;Sharepoing server home page&lt;br /&gt;&lt;a href="http://office.microsoft.com/en-us/sharepointserver/default.aspx"&gt;http://office.microsoft.com/en-us/sharepointserver/default.aspx&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;Sharepoint 2007 Server help page&lt;br /&gt;&lt;a href="http://office.microsoft.com/en-us/sharepointserver/FX101211721033.aspx"&gt;http://office.microsoft.com/en-us/sharepointserver/FX101211721033.aspx&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;Sharepoint Server 2007 Virtual PC Harddrive Image&lt;br /&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=67f93dcb-ada8-4db5-a47b-df17e14b2c74&amp;DisplayLang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=67f93dcb-ada8-4db5-a47b-df17e14b2c74&amp;DisplayLang=en&lt;/a&gt;&lt;br /&gt;This image runs a Windows Server 2003 R2 Enterprise Edition machine. The virtual machine is for evaluation purposes and will expire after 30 days. You can login to the image using the following creditentials:&lt;br /&gt;Username: Administrator&lt;br /&gt;Password: pass@word1&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;Sharepoint Server 2007 Virtual PC Harddrive Image with Instructions and Walkthrough&lt;br /&gt;&lt;a href="https://connect.microsoft.com/Downloads/DownloadDetails.aspx?SiteID=428&amp;DownloadID=7004"&gt;https://connect.microsoft.com/Downloads/DownloadDetails.aspx?SiteID=428&amp;DownloadID=7004&lt;/a&gt;&lt;br /&gt;This image has been expired but can still be used for an hour each time the virtual machine is started.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;Let me know if you find this of help.&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1139322805879086422-5319645971580860830?l=dotnetaffairs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetaffairs.blogspot.com/feeds/5319645971580860830/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1139322805879086422&amp;postID=5319645971580860830' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/5319645971580860830'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/5319645971580860830'/><link rel='alternate' type='text/html' href='http://dotnetaffairs.blogspot.com/2008/04/microsoft-office-sharepoint-server.html' title='Microsoft Office Sharepoint Server Resources'/><author><name>T Alrahem</name><uri>http://www.blogger.com/profile/09938150493349755377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1139322805879086422.post-6902119689219356448</id><published>2008-03-30T23:45:00.000-07:00</published><updated>2008-04-05T00:37:26.237-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='firefox'/><category scheme='http://www.blogger.com/atom/ns#' term='os'/><category scheme='http://www.blogger.com/atom/ns#' term='macintel'/><category scheme='http://www.blogger.com/atom/ns#' term='operating system'/><category scheme='http://www.blogger.com/atom/ns#' term='mac'/><category scheme='http://www.blogger.com/atom/ns#' term='browser'/><title type='text'>Checking OS and Browser with Javascript</title><content type='html'>&lt;p&gt;&lt;br /&gt;I've ran into cases where different browsers and even the same browsers but on different OS's respond differently to CSS attributes. So in some cases it's best to check for the type of OS and browser and apply attributes accordingly. I recently had to deal with this issue for the Firefox browser on Mac.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;It turns out that having an HTML element with a CSS opacity attribute interferes with Flash graphics on the web page if it lays over it. As far as I noticed this only happens currently when using Firefox on Mac. Since opacity wasn't a requirement and wasn't of importance I decided to take it out on that browser/OS combination. This is done by code like the following:&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;function checkOSBrowser() {&lt;br /&gt;     if(navigator.platform.indexOf("Mac") || navigator.userAgent.indexOf("Firefox"))&lt;br /&gt;          document.getElementById("myElem").style.opacity = "0.8";&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;To review, navigator.platform returns the current OS and navigator.userAgent returns the running browser name. It is generally better to use indexOf() or search() to look for the desired OS or browser than to use an exact match because if anything slightly changed with an exact match the match would fail. Take "Mac" for example. If you run navigator.platform on a Mac machine with Intel processors, the output would be "MacIntel" not "Mac." So if you don't care exactly what kind of Mac is running you should just use the indexOf() or search() functions provided by the Javascript String.&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1139322805879086422-6902119689219356448?l=dotnetaffairs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetaffairs.blogspot.com/feeds/6902119689219356448/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1139322805879086422&amp;postID=6902119689219356448' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/6902119689219356448'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/6902119689219356448'/><link rel='alternate' type='text/html' href='http://dotnetaffairs.blogspot.com/2008/03/checking-os-and-browser-with-javascript.html' title='Checking OS and Browser with Javascript'/><author><name>T Alrahem</name><uri>http://www.blogger.com/profile/09938150493349755377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1139322805879086422.post-8710699661370896800</id><published>2008-02-21T00:10:00.000-08:00</published><updated>2008-02-21T00:16:23.597-08:00</updated><title type='text'>Google JavaScript Trick</title><content type='html'>Here is a cool browser JavaScript trick. Go to www.google.com then in the address bar of the browser paste the following and press Enter:&lt;br /&gt;&lt;br /&gt;"javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI=document.images; DIL=DI.length; function A(){for(i=0; i-DIL; i++){DIS=DI[ i ].style; DIS.position='absolute'; DIS.left=Math.sin(R*x1+i*x2+x3)*x4+x5; DIS.top=Math.cos(R*y1+i*y2+y3)*y4+y5}R++}setInterval('A()',5 ); void(0);"&lt;br /&gt;&lt;br /&gt;without the quotes. The Google logo should start dancing. You can still use the Google search while the logo is bouncing around the page though. Like it?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1139322805879086422-8710699661370896800?l=dotnetaffairs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetaffairs.blogspot.com/feeds/8710699661370896800/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1139322805879086422&amp;postID=8710699661370896800' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/8710699661370896800'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/8710699661370896800'/><link rel='alternate' type='text/html' href='http://dotnetaffairs.blogspot.com/2008/02/google-javascript-trick.html' title='Google JavaScript Trick'/><author><name>T Alrahem</name><uri>http://www.blogger.com/profile/09938150493349755377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1139322805879086422.post-7864323729999495252</id><published>2008-02-15T00:58:00.000-08:00</published><updated>2008-05-23T23:48:44.931-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='float property'/><category scheme='http://www.blogger.com/atom/ns#' term='css'/><title type='text'>Javascript Naming for CSS Float Property</title><content type='html'>Typically, you can access a CSS property of an element in Javascript using something similar to:&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;br /&gt;&lt;code&gt;elem.style.propertyName = "value";&lt;/code&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Where the propertyName is the property name in CSS with no dashes and written in camel format. For example text-align becomes textAlign. However, for the CSS float property this is a problem because float a keyword in Javascript. Therefore instead you have to use &lt;b&gt;cssFloat&lt;/b&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1139322805879086422-7864323729999495252?l=dotnetaffairs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetaffairs.blogspot.com/feeds/7864323729999495252/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1139322805879086422&amp;postID=7864323729999495252' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/7864323729999495252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/7864323729999495252'/><link rel='alternate' type='text/html' href='http://dotnetaffairs.blogspot.com/2008/02/javascript-naming-for-css-float.html' title='Javascript Naming for CSS Float Property'/><author><name>T Alrahem</name><uri>http://www.blogger.com/profile/09938150493349755377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1139322805879086422.post-50022660226243861</id><published>2008-02-11T18:43:00.000-08:00</published><updated>2008-06-02T02:34:38.133-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='state management'/><category scheme='http://www.blogger.com/atom/ns#' term='state'/><category scheme='http://www.blogger.com/atom/ns#' term='application state'/><category scheme='http://www.blogger.com/atom/ns#' term='asp .net'/><title type='text'>State Management with ASP .NET 2.0 - 2</title><content type='html'>In the previous &lt;a href="http://dotnetaffairs.blogspot.com/2007/11/first.html"&gt;post&lt;/a&gt; about state management I talked about the ViewState collection. Today I will write about the Application collection.&lt;br /&gt;&lt;br /&gt;2. Application State Collection&lt;br /&gt;&lt;br /&gt;The Application collection is an object collection that maps strings to objects. The unique aspect of the Application collection is that it is a global variable such that it is shared throughout the entire ASP .NET application. The Application collection has the same life span as the ASP .NET process and dies or is cleared when the process is killed or restarted.&lt;br /&gt;&lt;br /&gt;The use of the Application collection is to store variables that need to be retained across different pages and shared amongst different users and sessions. An example of something that might be stored in the Application collection would be a counter of some sort that is shared amongst pages and sessions.&lt;br /&gt;&lt;br /&gt;The Application collection is used like any collection in .NET. To store something (in code behind):&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;code&gt;int n = 0;&lt;br /&gt;Application["keyID"] = n;&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;To retrieve a variable from the collection:&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;code&gt;int x = (int)Application["keyID"];&lt;/code&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1139322805879086422-50022660226243861?l=dotnetaffairs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetaffairs.blogspot.com/feeds/50022660226243861/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1139322805879086422&amp;postID=50022660226243861' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/50022660226243861'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/50022660226243861'/><link rel='alternate' type='text/html' href='http://dotnetaffairs.blogspot.com/2008/02/state-management-with-asp-net-20-2.html' title='State Management with ASP .NET 2.0 - 2'/><author><name>T Alrahem</name><uri>http://www.blogger.com/profile/09938150493349755377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1139322805879086422.post-3250755513432682404</id><published>2008-02-09T03:23:00.000-08:00</published><updated>2008-02-09T03:43:40.766-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='google logo'/><category scheme='http://www.blogger.com/atom/ns#' term='black and white'/><title type='text'>Make Google Black and White</title><content type='html'>&lt;p&gt;&lt;br /&gt;Have you ever dreamed about seeing how the Google logo looks in black and white (or grey scale).  Well, there is a chance for you. Just go to &lt;a href="http://google.com"&gt;google.com&lt;/a&gt; and type "make google black and white" then press "I am feeling lucky." And if today is your lucky day, the Google logo will switch to black and white :). Actually it should switch anyway.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="http://sitepictures.googlepages.com/logo.png" alt="Google log in black and white" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;So how does that work? It turns out that there is a web site that totally mimicks the Google web site look in a signed off state. But it has a logo in black and white. More importantly, this site happens to be the first result on Google search when you search for "make google black and white." Pressing the "I am feeling lucky" button has the same effect as going to the first link in the search results. So when you press the button you are actually going a new site but since everything looks the same except for the logo, it looks like as if Google understood what you wanted and changed its logo like magic. But sorry not this time. No magic there.&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1139322805879086422-3250755513432682404?l=dotnetaffairs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetaffairs.blogspot.com/feeds/3250755513432682404/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1139322805879086422&amp;postID=3250755513432682404' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/3250755513432682404'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/3250755513432682404'/><link rel='alternate' type='text/html' href='http://dotnetaffairs.blogspot.com/2008/02/make-google-black-and-white.html' title='Make Google Black and White'/><author><name>T Alrahem</name><uri>http://www.blogger.com/profile/09938150493349755377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1139322805879086422.post-1543491115630806616</id><published>2008-02-04T17:24:00.000-08:00</published><updated>2008-02-04T19:16:10.893-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='submit'/><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='enter key press'/><category scheme='http://www.blogger.com/atom/ns#' term='form'/><title type='text'>Submitting a Form upon Pressing the Enter Key</title><content type='html'>&lt;p&gt;&lt;br /&gt;It is very common on web forms that a page is desired to submit its form when a user presses the Enter key while the focus in a certain or any text box.  This is typically done using JavaScript.  I want to share how it's done as it can be very useful. In essence all that is done is that every time a user presses a key, a JavaScript code checks if the key pressed is the Enter key. If so it submits the form to the server, otherwise it does nothing. The following is a snippet of the code would look like:&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;On the JavaScript side&lt;/span&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;br /&gt;&lt;code&gt;&lt;pre&gt;&lt;br /&gt;function enter_submit(pevent)&lt;br /&gt;{&lt;br /&gt;   if(window.event) //Internet Explorer&lt;br /&gt;   {&lt;br /&gt;      if(myEvent.keyCode == 13) //check enter was pressed&lt;br /&gt;      {&lt;br /&gt;         document.formname.submit();&lt;br /&gt;         //or __doPostBack("",''); &lt;br /&gt;  return;&lt;br /&gt;      }&lt;br /&gt;   }&lt;br /&gt;   else if(pevent.which) // Netscape/Firefox/Opera &lt;br /&gt;   {&lt;br /&gt;      var pressed = pevent.which; &lt;br /&gt;      if(pressed == 13)&lt;br /&gt;         document.formname.submit();&lt;br /&gt;         //or __doPostBack('','');&lt;br /&gt;   } &lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/code&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;On the HTML or ASP .NET side&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;br /&gt;&lt;code&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;asp:Textbox ID="txtPassword" runat="server" onkeypress="javascript:enter_submit(event);/&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;input id="inPassword" type="password" onkeypress="enter_submit(event);"/&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/code&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1139322805879086422-1543491115630806616?l=dotnetaffairs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetaffairs.blogspot.com/feeds/1543491115630806616/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1139322805879086422&amp;postID=1543491115630806616' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/1543491115630806616'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/1543491115630806616'/><link rel='alternate' type='text/html' href='http://dotnetaffairs.blogspot.com/2008/02/submitting-form-upon-pressing-enter-key.html' title='Submitting a Form upon Pressing the Enter Key'/><author><name>T Alrahem</name><uri>http://www.blogger.com/profile/09938150493349755377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1139322805879086422.post-4524072678665417511</id><published>2008-01-22T19:39:00.000-08:00</published><updated>2008-01-22T20:29:51.406-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='confirm'/><category scheme='http://www.blogger.com/atom/ns#' term='asp:button'/><category scheme='http://www.blogger.com/atom/ns#' term='post back'/><title type='text'>asp:Button and Javascript</title><content type='html'>It is useful many times to decide the behavior of a button based on some client side code result. For example, when a button is pressed a web page might need to execute Javascript code to validate some user input or to have the user confirm a certain action and based on the output of the client code either post back to the web server or ignore the click or execute more client side code.&lt;br /&gt;&lt;br /&gt;Let's take the scenario of asking the user to confirm a certain action as this scenario has actually come up with me at a client. The web page has a button that deletes an object permanently. Upon a user click on the button, the page executes Javascript code to open a confirmation box with an OK and a Cancel button. The confirmation box should at the least minimize accidental deletions. If the user clicks OK the page posts back and the object is deleted. However, if the user clicks Cancel the button click is ignored and nothing happens. Let's take a look at the code behind this:&lt;br /&gt;&lt;br /&gt;Javascript part:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&gt;&lt;br /&gt;function confirmDelete() {&lt;br /&gt;return window.confirm("You really want to delete all your work?");&lt;br /&gt;}&lt;br /&gt;&amp;lt;/script&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;ASPX side:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&amp;lt;asp:button id="btnDelete" onclick="btnDelete_Click" runat="server" text="Delete" tooltip="Permanetly remove this item" onclientclick="javascript:return confirmDelete();" /&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;That's it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1139322805879086422-4524072678665417511?l=dotnetaffairs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetaffairs.blogspot.com/feeds/4524072678665417511/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1139322805879086422&amp;postID=4524072678665417511' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/4524072678665417511'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/4524072678665417511'/><link rel='alternate' type='text/html' href='http://dotnetaffairs.blogspot.com/2008/01/aspbutton-and-javascript.html' title='asp:Button and Javascript'/><author><name>T Alrahem</name><uri>http://www.blogger.com/profile/09938150493349755377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1139322805879086422.post-3467406558830559573</id><published>2008-01-22T17:26:00.000-08:00</published><updated>2008-01-22T20:38:54.768-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='beta exams'/><category scheme='http://www.blogger.com/atom/ns#' term='free online training'/><title type='text'>Free Online Silverlight Training Resources</title><content type='html'>I wanted to share some free online resources for the new Microsoft web technology Silverlight.&lt;br /&gt;&lt;br /&gt;Microsoft Press E-Book: Introducing Silverlight 1.0&lt;br /&gt;&lt;a href="http://csna01.libredigital.com/?urvs5cn3s8"&gt;http://csna01.libredigital.com/?urvs5cn3s8&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;visitmix.com Firestarter:&lt;br /&gt;&lt;a href="http://www.visitmix.com/University/silverlight/firestarter/" target="_blank"&gt;http://www.visitmix.com/University/silverlight/firestarter/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Lynda.com Training:&lt;br /&gt;&lt;a href="http://movielibrary.lynda.com/html/modPage.asp?ID=473" target="_blank"&gt;http://movielibrary.lynda.com/html/modPage.asp?ID=473&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;On another note, Microsoft has extended the deadlines for 3 beta exams.&lt;br /&gt;From: &lt;a href="http://blogs.msdn.com/trika/archive/2008/01/14/wpf-wcf-workflow-beta-exams-extended.aspx"&gt;Trika msdn blog&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The dates for the following three betas have been extended and you are welcome to spread the word. taking a beta exam is free. If you pass it, you have passed that exam (and earned the related certification, if applicable)--you do not need to take the live version of the exam. if you've never taken a beta exam before, read &lt;a class="" href="http://blogs.msdn.com/trika/archive/2006/11/13/everyone-s-panties-are-in-a-bunch-vista-beta-exam-71-620.aspx" mce_href="http://blogs.msdn.com/trika/archive/2006/11/13/everyone-s-panties-are-in-a-bunch-vista-beta-exam-71-620.aspx"&gt;this&lt;/a&gt;. If you have questions, check out &lt;a class="" href="http://blogs.msdn.com/gerryo" mce_href="http://blogs.msdn.com/gerryo"&gt;Gerry's Blog&lt;/a&gt;, I'm sure he'll be posting this info too and he knows more about it than YT.&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;71-502: TS: Microsoft .NET Framework 3.5 - Windows Presentation Foundation&lt;br /&gt;extended through 1/24&lt;br /&gt;502B1 is the code&lt;br /&gt;Link to PrepGuide: &lt;a href="http://www.microsoft.com/learning/exams/70-502.mspx"&gt;http://www.microsoft.com/learning/exams/70-502.mspx&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;71-503: TS: Microsoft .NET Framework 3.5 - Windows Communication Foundation&lt;br /&gt;Extended through 1/25&lt;br /&gt;503B1 is the code&lt;br /&gt;Link to PrepGuide: &lt;a href="http://www.microsoft.com/learning/exams/70-503.mspx"&gt;http://www.microsoft.com/learning/exams/70-503.mspx&lt;/a&gt; &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;71-504: TS: Microsoft .NET Framework 3.5 – Windows Workflow Foundation&lt;br /&gt;Extended through 1/25&lt;br /&gt;504B1 is the code&lt;br /&gt;Link to PrepGuide: &lt;a href="http://www.microsoft.com/learning/exams/70-504.mspx"&gt;http://www.microsoft.com/learning/exams/70-504.mspx&lt;/a&gt; &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;br /&gt;Link to registration: &lt;a href="http://www.register.prometric.com/ClientInformation.asp"&gt;http://www.register.prometric.com/ClientInformation.asp&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;· Not available in China, India, Pakistan&lt;br /&gt;· Need to stress there’s no guarantee of a seat&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1139322805879086422-3467406558830559573?l=dotnetaffairs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetaffairs.blogspot.com/feeds/3467406558830559573/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1139322805879086422&amp;postID=3467406558830559573' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/3467406558830559573'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/3467406558830559573'/><link rel='alternate' type='text/html' href='http://dotnetaffairs.blogspot.com/2008/01/free-online-silverlight-training.html' title='Free Online Silverlight Training Resources'/><author><name>T Alrahem</name><uri>http://www.blogger.com/profile/09938150493349755377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1139322805879086422.post-2600761403437197817</id><published>2008-01-06T02:30:00.000-08:00</published><updated>2008-01-23T15:09:59.952-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='submit'/><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='form'/><title type='text'>Submitting Files to Multiple Sites</title><content type='html'>An issue came up recently at my client where the client wanted to keep a backup copy of every file submitted by a user to a third-party site. The backup copy was going to be saved a separate server. The solution I implemented was some simple JavaScript code. Essentially, the code submits the form to one site then changes the "action" and "target" properties of the form and submits it again to the other site. The new target could be an HTML iframe or a new window. In my case it was a small popup window. Here is a sample of the code:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;function submitForms() {&lt;br /&gt;window.open("", "smallPopup", "location=1, status=1, scrollbars=1, width=100, height=100");&lt;br /&gt;var theForm = document.myForm;&lt;br /&gt;theForm.action = "http://firstSite.com/backup";&lt;br /&gt;theForm.target = "smallPopup";&lt;br /&gt;theForm.submit();&lt;br /&gt;&lt;br /&gt;theForm.action = "http://2ndSite.com/receive";&lt;br /&gt;theForm.target = "_self";&lt;br /&gt;theForm.submit();&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Now you might wonder why I didn't just create another form and have two forms, one for each server. The problem with that is the user would have to select the file twice, once for each form. This is because for security reasons, it is not possible to programmatically set the file path in an HTML input of type file. So a programmer is prevented from assigning the path of one input tag to be the same as another input tag of type file. A programmer only has read access to the file path. Of course this makes a lot of sense too because if it were possible then any malicious site would be able to upload any file its owner wishes from your computer to his server.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1139322805879086422-2600761403437197817?l=dotnetaffairs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetaffairs.blogspot.com/feeds/2600761403437197817/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1139322805879086422&amp;postID=2600761403437197817' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/2600761403437197817'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/2600761403437197817'/><link rel='alternate' type='text/html' href='http://dotnetaffairs.blogspot.com/2008/01/submitting-files-to-multiple-sites.html' title='Submitting Files to Multiple Sites'/><author><name>T Alrahem</name><uri>http://www.blogger.com/profile/09938150493349755377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1139322805879086422.post-6521885649404126196</id><published>2007-12-15T09:25:00.000-08:00</published><updated>2007-12-15T11:31:33.939-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='exam'/><category scheme='http://www.blogger.com/atom/ns#' term='mcpd'/><title type='text'>Interesting MCPD Exam Question</title><content type='html'>Going through some &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;MCPD&lt;/span&gt; practice exam questions, I ran into an interesting question I wanted to share.  This questions highlights a programming philosophy in .NET coding that is encouraged by Microsoft.&lt;br /&gt;&lt;br /&gt;Here is the question:&lt;br /&gt;Click to expand any image.&lt;br /&gt;&lt;a href="http://sitepictures.googlepages.com/question.jpg"&gt;&lt;br /&gt;&lt;img src="http://sitepictures.googlepages.com/question.jpg" alt="question not avaiable" width="480" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The choices for answers are:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sitepictures.googlepages.com/choices.jpg"&gt;&lt;br /&gt;&lt;img src="http://sitepictures.googlepages.com/choices.jpg" alt="choices not available" width="480" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now on a first look, it seems like the correct answer is the first choice since indeed the code does satisfy the requirements.  However, the correct answer is the one highlighted.  Here is why:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sitepictures.googlepages.com/explanation.jpg"&gt;&lt;br /&gt;&lt;img src="http://sitepictures.googlepages.com/explanation.jpg" alt="explanation not available" width="480" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Interesting huh?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1139322805879086422-6521885649404126196?l=dotnetaffairs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetaffairs.blogspot.com/feeds/6521885649404126196/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1139322805879086422&amp;postID=6521885649404126196' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/6521885649404126196'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/6521885649404126196'/><link rel='alternate' type='text/html' href='http://dotnetaffairs.blogspot.com/2007/12/interesting-mcpd-exam-question.html' title='Interesting MCPD Exam Question'/><author><name>T Alrahem</name><uri>http://www.blogger.com/profile/09938150493349755377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1139322805879086422.post-346776013819684805</id><published>2007-12-12T18:39:00.000-08:00</published><updated>2007-12-15T09:33:49.998-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mvc'/><category scheme='http://www.blogger.com/atom/ns#' term='asp .net'/><title type='text'>ASP .NET Model View Controller</title><content type='html'>Last week on Monday, Dec 3rd, I went to an &lt;a href="http://www.ladotnet.org/EventDescription.asp?175"&gt;event&lt;/a&gt; hosted by &lt;a href="http://www.ladotnet.org/"&gt;ladotnet.org&lt;/a&gt; about the new ASP .NET Model View Controller (MVC) framework. The guest speaker was &lt;a href="http://haacked.com/"&gt;Phil Haack&lt;/a&gt; who is currently at Microsoft working on MVC. Overall I think the concept behind MVC is great. The framework looks promising.  However, there are some drawbacks which I will just mention.  Below is a summary of major points gathered from the meeting:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;MVC framework is built on the idea of separating the view and controller parts.&lt;/li&gt;&lt;li&gt;MVC is not a replacement to WebForms but just an alternative.&lt;/li&gt;&lt;li&gt;MVC pages cannot contain controls that require a postback.&lt;/li&gt;&lt;li&gt;ViewState does not work with MVC.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;MVC allows for using "REST"-like URLs (friendly looking URLs).&lt;/li&gt;&lt;li&gt;MVC generates cleaner HTML code that does not require ID munging.&lt;/li&gt;&lt;li&gt;In the MVC framework, URLs map to actions not pages.&lt;/li&gt;&lt;/ul&gt;More information on MVC should follow later as I test it and learn more about it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1139322805879086422-346776013819684805?l=dotnetaffairs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetaffairs.blogspot.com/feeds/346776013819684805/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1139322805879086422&amp;postID=346776013819684805' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/346776013819684805'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/346776013819684805'/><link rel='alternate' type='text/html' href='http://dotnetaffairs.blogspot.com/2007/12/asp-net-model-view-controller.html' title='ASP .NET Model View Controller'/><author><name>T Alrahem</name><uri>http://www.blogger.com/profile/09938150493349755377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1139322805879086422.post-6204761351413924331</id><published>2007-12-08T02:21:00.000-08:00</published><updated>2007-12-10T20:31:35.235-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='post'/><category scheme='http://www.blogger.com/atom/ns#' term='form'/><category scheme='http://www.blogger.com/atom/ns#' term='css'/><category scheme='http://www.blogger.com/atom/ns#' term='button'/><title type='text'>Modifying CSS Styles with JavaScript</title><content type='html'>I recently came a cross problem at a client where I needed the page content to change upon a button click before the page is posted back.  For example, imagine you have a page used to upload files.  You want the page to display something like "Your file is being uploaded" right when the user clicks the upload button.  Then the page is posted back while the desired message is displayed.  The solution I came up with utilized JavaScript to modify the Cascading Style Sheets, CSS, of the page and then post.  &lt;br /&gt;The solution was as simple as adding multiple wrapping div's around the content.  This could actually be done with only two div's but for my page I need three.  The div that had to be shown when the page is first requested had a default CSS Display property value of "block."  The div that was to be shown after the user clicks a button had Display value of "hidden."  In the code that executed following the button click as shown below, one div is being hidden, one is modified to be shown, and lastly the page is posted.  The JavaScript code I had was similar to the following:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;function btnClick()&lt;br /&gt;{&lt;br /&gt;   document.getElementById("initialDiv").style["display"] = "hidden";&lt;br /&gt;   document.getElementById("secondDiv").style["display"] = "block";&lt;br /&gt;   document.form1.submit();&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1139322805879086422-6204761351413924331?l=dotnetaffairs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetaffairs.blogspot.com/feeds/6204761351413924331/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1139322805879086422&amp;postID=6204761351413924331' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/6204761351413924331'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/6204761351413924331'/><link rel='alternate' type='text/html' href='http://dotnetaffairs.blogspot.com/2007/12/modifying-css-styles-with-javascript.html' title='Modifying CSS Styles with JavaScript'/><author><name>T Alrahem</name><uri>http://www.blogger.com/profile/09938150493349755377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1139322805879086422.post-5392166971845855871</id><published>2007-11-29T23:44:00.000-08:00</published><updated>2007-11-30T20:11:46.500-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='html events'/><category scheme='http://www.blogger.com/atom/ns#' term='asp:button'/><category scheme='http://www.blogger.com/atom/ns#' term='html attributes'/><category scheme='http://www.blogger.com/atom/ns#' term='events'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><category scheme='http://www.blogger.com/atom/ns#' term='attributes'/><category scheme='http://www.blogger.com/atom/ns#' term='asp .net'/><category scheme='http://www.blogger.com/atom/ns#' term='button'/><title type='text'>ASP .NET | Client/Server Side Action with asp:Button</title><content type='html'>The asp:Button imitates the HTML input button's onclick event by having a property called OnClick. However, this property can only be set to a valid method name that is executed on the server. More, since the property is named the same as the HTML event, it's not possible to add client side code directly to the asp:Button tag using the onclick attribute that gets excecuted upon a click.&lt;br /&gt;&lt;br /&gt;ASP solves this problem by adding another property called OnClientClick that can be set to execute any client side code. Then during compilation, the ASP .NET worker process consolidates both codes into the one HTML event 'onclick' because both codes must be executed upon the same event, a click. ASP .NET only compiles a page if it's modified otherwise it grabs the page from the cache by default. For the server side code, the only thing that is added is client side code that posts the page back using the button id to identify the control that caused the post back. After the page is posted back, the server side code gets executed.&lt;br /&gt;&lt;br /&gt;In contrast, since other events don't have a matching asp:Button property they can be added directly to the asp:Button tag and ASP .NET will add them to the HTML tag generated for the button. For example, onfocus, onblur, onselect and other event attributes can be added directly as follows:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&amp;lt;asp:button id="btnPost" runat="server" onblur="javascript:blured()" onfocus="javascript:focused();" /&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;HTML attributes can also be added progromatically such as in C#:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;btnPost.Attributes.Add("ondblclick", "javascript:dblClicked();");&lt;br /&gt;btnPost.Attributes["onkeypress"] = "javascript:pressed();";&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1139322805879086422-5392166971845855871?l=dotnetaffairs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetaffairs.blogspot.com/feeds/5392166971845855871/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1139322805879086422&amp;postID=5392166971845855871' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/5392166971845855871'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/5392166971845855871'/><link rel='alternate' type='text/html' href='http://dotnetaffairs.blogspot.com/2007/11/asp-net-clientserver-side-action-with.html' title='ASP .NET | Client/Server Side Action with asp:Button'/><author><name>T Alrahem</name><uri>http://www.blogger.com/profile/09938150493349755377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1139322805879086422.post-6062820357424309937</id><published>2007-11-25T14:58:00.000-08:00</published><updated>2008-06-02T02:32:13.081-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='first'/><category scheme='http://www.blogger.com/atom/ns#' term='blog'/><category scheme='http://www.blogger.com/atom/ns#' term='post'/><category scheme='http://www.blogger.com/atom/ns#' term='blogging'/><title type='text'>State Management with ASP .NET 2.0 - 1</title><content type='html'>There is a fundemental problem with building complex stateful web application. The HTTP protocol is stateless and hence each request is a new request to the web server as far as the HTTP server is concerned. ASP .NET 2.0 solves this problem using several options. I will start with the View State and cover the rest in the upcoming posts.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;View State Collection&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;The View State collection can be used to store objects of any type to be retrieved whenever needed unique to each client. The View State is stored within the HTML code rendered to the client as a string. If you take a look at the HTML source of a page generated by ASP .NET and is using view state, you will find an input tag that looks like:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&amp;lt;input id="__VIEWSTATE" name="__VIEWSTATE" value="/wEPDwULLTE5ODI3MTMwMDkPZBYCAgEPZBYKZg9k" type="hidden"&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Anything stored in the View State collection will be encoded into a  Base64 string and included in the HTML code for the page generated in the value of the __VIEWSTATE input tag. This same tag automatically stores the visual information of web controls that have View State enabled, thus the naming "View State."  When a page is posted, ASP .NET checks the __VIEWSTATE value and restores the state of the page including any user entered fields and progromattically inserted objects.  By default the View State is enabled for an ASP .NET page.  To disable View State include 'EnableViewState="false"' in the beginning &amp;lt;%@ Page tag.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&amp;lt;%@Page EnableViewState="false" ... &amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Also by default the View State code is tamper-proofed using a hash code.  ASP .NET makes a hash of the View State code using a private key and appends it to the View State value.  When a page is posted back, ASP .NET recomputes the hash and checks that they match.  Developers also have the option of encrypting the View State value.  Encryption can be enabled per page or per site in the config file.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&amp;lt;%@Page ViewStateEncryptionMode="Always" ... &amp;gt;&lt;/code&gt;&lt;br /&gt;Or&lt;br /&gt;&lt;code&gt;&amp;lt;system.web&amp;gt;&lt;br /&gt;&amp;lt;pages viewStateEncryptionMode="Always" /&amp;gt;&lt;br /&gt;...&lt;br /&gt;&amp;lt;/system.web&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;There are three encryption modes:&lt;br /&gt;Always: encrypt view state information for all controls&lt;br /&gt;Never: encrypt view state information for none of the controls&lt;br /&gt;Auto: encrypt view state information only if a control requests it by calling Page.RegisterRequiresViewStateEncryption()&lt;/p&gt;&lt;br /&gt;Using the view state collection is just as easy as using any collection.  Objects can be inserted into the collection using a key/value pair.  The key however has to be of type string. For example,&lt;br /&gt;&lt;br /&gt;ViewState["key"] = "this is a value";&lt;br /&gt;&lt;br /&gt;Since data is stored as object, to retrieve it in the right type it must be type casted.&lt;br /&gt;&lt;br /&gt;string value = (string) ViewState["key"];&lt;br /&gt;&lt;br /&gt;This concludes the view state part of state management. I hope this was useful and informative. Would love to see your comments and know what you think.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1139322805879086422-6062820357424309937?l=dotnetaffairs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetaffairs.blogspot.com/feeds/6062820357424309937/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1139322805879086422&amp;postID=6062820357424309937' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/6062820357424309937'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/6062820357424309937'/><link rel='alternate' type='text/html' href='http://dotnetaffairs.blogspot.com/2007/11/first.html' title='State Management with ASP .NET 2.0 - 1'/><author><name>T Alrahem</name><uri>http://www.blogger.com/profile/09938150493349755377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1139322805879086422.post-5174500675922651539</id><published>2007-11-25T02:25:00.000-08:00</published><updated>2007-12-08T02:58:16.142-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='view state'/><category scheme='http://www.blogger.com/atom/ns#' term='state management'/><category scheme='http://www.blogger.com/atom/ns#' term='state'/><category scheme='http://www.blogger.com/atom/ns#' term='asp .net'/><title type='text'>The First</title><content type='html'>This is my first post on this blog. In fact this is my first blog post period. My hope is that this blog will make a contribution to the Internet plethora of information.&lt;br /&gt;&lt;br /&gt;Currently I am a consultant software developer working for &lt;a href="http://avanade.com/"&gt;Avanade&lt;/a&gt;, a joint venture between &lt;a href="http://microsoft.com/"&gt;Microsoft&lt;/a&gt; and &lt;a href="http://accenture.com/"&gt;Accenture&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Thoulfekar&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1139322805879086422-5174500675922651539?l=dotnetaffairs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetaffairs.blogspot.com/feeds/5174500675922651539/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1139322805879086422&amp;postID=5174500675922651539' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/5174500675922651539'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1139322805879086422/posts/default/5174500675922651539'/><link rel='alternate' type='text/html' href='http://dotnetaffairs.blogspot.com/2007/11/state-management-with-asp-net-20-1.html' title='The First'/><author><name>T Alrahem</name><uri>http://www.blogger.com/profile/09938150493349755377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
