<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Todd Taylor's Blog - VB.NET</title>
    <link>http://blog.toddtaylor.com/</link>
    <description />
    <language>en-us</language>
    <copyright>Todd M. Taylor</copyright>
    <lastBuildDate>Wed, 07 Jun 2006 19:13:10 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.0.7226.0</generator>
    <managingEditor>toddtaylor@toddtaylor.com</managingEditor>
    <webMaster>toddtaylor@toddtaylor.com</webMaster>
    <item>
      <trackback:ping>http://blog.toddtaylor.com/Trackback.aspx?guid=8701b2b9-1e9d-43a6-a04a-460d32871bf6</trackback:ping>
      <pingback:server>http://blog.toddtaylor.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.toddtaylor.com/PermaLink,guid,8701b2b9-1e9d-43a6-a04a-460d32871bf6.aspx</pingback:target>
      <dc:creator>Todd M. Taylor</dc:creator>
      <wfw:comment>http://blog.toddtaylor.com/CommentView,guid,8701b2b9-1e9d-43a6-a04a-460d32871bf6.aspx</wfw:comment>
      <wfw:commentRss>http://blog.toddtaylor.com/SyndicationService.asmx/GetEntryCommentsRss?guid=8701b2b9-1e9d-43a6-a04a-460d32871bf6</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Ok, ok... it's not stealing because Microsoft said we can do it!   If you've
ever wondered if you could use the icons in Visual Studio for other applications,
apparently you can: <a href="http://blogs.msdn.com/brada/archive/2006/06/06/618797.aspx">Brad
Abrams Blog: Standard Microsoft Icons</a></p>
      </body>
      <title>Stealing Microsoft Icons</title>
      <guid isPermaLink="false">http://blog.toddtaylor.com/PermaLink,guid,8701b2b9-1e9d-43a6-a04a-460d32871bf6.aspx</guid>
      <link>http://blog.toddtaylor.com/2006/06/07/StealingMicrosoftIcons.aspx</link>
      <pubDate>Wed, 07 Jun 2006 19:13:10 GMT</pubDate>
      <description>&lt;p&gt;
Ok, ok... it's not stealing because Microsoft said we can do it! &amp;nbsp; If you've
ever wondered if you could use the icons in Visual Studio for other applications,
apparently you can: &lt;a href="http://blogs.msdn.com/brada/archive/2006/06/06/618797.aspx"&gt;Brad
Abrams Blog: Standard Microsoft Icons&lt;/a&gt;
&lt;/p&gt;</description>
      <comments>http://blog.toddtaylor.com/CommentView,guid,8701b2b9-1e9d-43a6-a04a-460d32871bf6.aspx</comments>
      <category>C#</category>
      <category>Geek Tips</category>
      <category>VB.NET</category>
    </item>
    <item>
      <trackback:ping>http://blog.toddtaylor.com/Trackback.aspx?guid=c74a7acf-fd0f-439a-816c-a77ae6756e8b</trackback:ping>
      <pingback:server>http://blog.toddtaylor.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.toddtaylor.com/PermaLink,guid,c74a7acf-fd0f-439a-816c-a77ae6756e8b.aspx</pingback:target>
      <dc:creator>Todd M. Taylor</dc:creator>
      <wfw:comment>http://blog.toddtaylor.com/CommentView,guid,c74a7acf-fd0f-439a-816c-a77ae6756e8b.aspx</wfw:comment>
      <wfw:commentRss>http://blog.toddtaylor.com/SyndicationService.asmx/GetEntryCommentsRss?guid=c74a7acf-fd0f-439a-816c-a77ae6756e8b</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
One thing that was painfully lacking in Visual Studio 2003 was the ability to work
with XML and XSLT.  Most people opted to purchase third party tools like XML
Spy to deal with VS.NET's inadequacies.  However, Visual Studio .NET 2005 has
a group of new tools that add things such as XSLT debugging and Intellisense that
make working with XML related files much more tolerable.
</p>
        <p>
In addition, the .NET Framework 2.0 has undergone some significant improvements in
the System.XML namespace.  If you work with XML on a frequent basis, you'll want
to be sure to read through these MSDN articles and see what's new in version 2:
</p>
        <ul>
          <li>
            <a href="http://msdn.microsoft.com/XML/BuildingXML/XMLinNETFramework/default.aspx?pull=/library/en-us/dnxmlnet/html/xmltools.asp">An
Introduction to the XML Tools in Visual Studio 2005</a>
          </li>
          <li>
            <a href="http://msdn.microsoft.com/XML/BuildingXML/XMLinNETFramework/default.aspx?pull=/library/en-us/dnexxml/html/xml05202002.asp">XML
Namespaces and How They Affect XPath and XSLT</a>
          </li>
          <li>
            <a href="http://msdn.microsoft.com/XML/BuildingXML/XMLinNETFramework/default.aspx?pull=/library/en-us/dnxml/html/sysxmlvs05.asp">What's
New in System.Xml for Visual Studio 2005 and the .NET Framework 2.0 Release</a>
          </li>
        </ul>
      </body>
      <title>Working with XML in the .NET 2.0 Framework</title>
      <guid isPermaLink="false">http://blog.toddtaylor.com/PermaLink,guid,c74a7acf-fd0f-439a-816c-a77ae6756e8b.aspx</guid>
      <link>http://blog.toddtaylor.com/2006/06/07/WorkingWithXMLInTheNET20Framework.aspx</link>
      <pubDate>Wed, 07 Jun 2006 18:44:04 GMT</pubDate>
      <description>&lt;p&gt;
One thing that was painfully lacking in Visual Studio 2003 was the ability to work
with XML and XSLT. &amp;nbsp;Most people opted to purchase third party tools like XML
Spy to deal with VS.NET's inadequacies. &amp;nbsp;However, Visual Studio .NET 2005 has
a group of new tools that add things such as XSLT debugging and Intellisense that
make working with XML related files much more tolerable.
&lt;/p&gt;
&lt;p&gt;
In addition, the .NET Framework 2.0 has undergone some significant improvements in
the System.XML namespace. &amp;nbsp;If you work with XML on a frequent basis, you'll want
to be sure to read through these MSDN articles and see what's new in version 2:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://msdn.microsoft.com/XML/BuildingXML/XMLinNETFramework/default.aspx?pull=/library/en-us/dnxmlnet/html/xmltools.asp"&gt;An
Introduction to the XML Tools in Visual Studio 2005&lt;/a&gt; 
&lt;li&gt;
&lt;a href="http://msdn.microsoft.com/XML/BuildingXML/XMLinNETFramework/default.aspx?pull=/library/en-us/dnexxml/html/xml05202002.asp"&gt;XML
Namespaces and How They Affect XPath and XSLT&lt;/a&gt; 
&lt;li&gt;
&lt;a href="http://msdn.microsoft.com/XML/BuildingXML/XMLinNETFramework/default.aspx?pull=/library/en-us/dnxml/html/sysxmlvs05.asp"&gt;What's
New in System.Xml for Visual Studio 2005 and the .NET Framework 2.0 Release&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;</description>
      <comments>http://blog.toddtaylor.com/CommentView,guid,c74a7acf-fd0f-439a-816c-a77ae6756e8b.aspx</comments>
      <category>ASP.NET</category>
      <category>C#</category>
      <category>VB.NET</category>
      <category>XML</category>
    </item>
    <item>
      <trackback:ping>http://blog.toddtaylor.com/Trackback.aspx?guid=2506498b-7307-4714-9de9-aa961c56f402</trackback:ping>
      <pingback:server>http://blog.toddtaylor.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.toddtaylor.com/PermaLink,guid,2506498b-7307-4714-9de9-aa961c56f402.aspx</pingback:target>
      <dc:creator />
      <wfw:comment>http://blog.toddtaylor.com/CommentView,guid,2506498b-7307-4714-9de9-aa961c56f402.aspx</wfw:comment>
      <wfw:commentRss>http://blog.toddtaylor.com/SyndicationService.asmx/GetEntryCommentsRss?guid=2506498b-7307-4714-9de9-aa961c56f402</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div class="Section1">
          <p class="MsoNormal">
            <span style="font-size:10.0pt;font-family:Arial">Should you ever find yourself needing
to write CAML queries (XML queries) against a SharePoint list, th<span style="color:black">e
U2U CAML </span>tool is quite helpful<span style="color:black">. U2U member Patrick
Tisseghem has a <a href="http://blog.u2u.info/DottextWeb/patrick/archive/2005/05/29/3522.aspx">nice
blog post</a> on how to use the tool which can be <a href="http://www.u2u.info/SharePoint/U2U%20Community%20Tools/Forms/AllItems.aspx">downloaded
form their web site</a>. </span></span>
          </p>
          <p class="MsoNormal">
            <span style="font-size:10.0pt;font-family:Arial">One thing to note is that the tool
wraps the query XML nodes within a </span>
            <span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&lt;Query&gt;&lt;/Query&gt;</span>
            <span style="font-size:10.0pt;font-family:Arial"> node. 
You’ll want to delete that node in your .NET code.  As a result, your CAML
query might look something like this: </span>
          </p>
          <p class="MsoNormal">
            <b>
              <span style="font-size:8.0pt;font-family:&quot;Courier New&quot;">Dim strQueryDate as String
= Microsoft.SharePoint.Utilities.SPUtility.CreateISO8601DateTimeFromSystemDateTime(CDate(“05/05/2006”))</span>
            </b>
          </p>
          <p class="MsoNormal">
            <b>
              <span style="font-size:8.0pt;font-family:&quot;Courier New&quot;">Dim strQuery as String
= “&lt;Where&gt;&lt;Geq&gt;&lt;FieldRef Name=””Created””
/&gt;&lt;Value Type=””DateTime””&gt;{0}&lt;/Value&gt;&lt;/Geq&gt;&lt;/Where&gt;”,
strQueryDate)</span>
            </b>
          </p>
          <p class="MsoNormal">
            <span style="font-size:10.0pt;font-family:Arial;color:black">Note the goofy </span>
            <b>
              <span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">CreateISO8601DateTimeFromSystemDateTime</span>
            </b>
            <span style="font-size:10.0pt;font-family:Arial;color:black"> method
that is used for the date… CAML uses an ISO8601 date format so you must use
this method if you want to do date comparisons.</span>
          </p>
        </div>
      </body>
      <title>Querying SharePoint with CAML</title>
      <guid isPermaLink="false">http://blog.toddtaylor.com/PermaLink,guid,2506498b-7307-4714-9de9-aa961c56f402.aspx</guid>
      <link>http://blog.toddtaylor.com/2006/05/15/QueryingSharePointWithCAML.aspx</link>
      <pubDate>Mon, 15 May 2006 21:45:39 GMT</pubDate>
      <description>

&lt;div class=Section1&gt;
&lt;p class=MsoNormal&gt;
&lt;span style='font-size:10.0pt;font-family:Arial'&gt;Should you ever find yourself needing
to write CAML queries (XML queries) against a SharePoint list, th&lt;span style='color:black'&gt;e
U2U CAML &lt;/span&gt;tool is quite helpful&lt;span style='color:black'&gt;. U2U member Patrick
Tisseghem has a &lt;a href="http://blog.u2u.info/DottextWeb/patrick/archive/2005/05/29/3522.aspx"&gt;nice
blog post&lt;/a&gt; on how to use the tool which can be &lt;a href="http://www.u2u.info/SharePoint/U2U%20Community%20Tools/Forms/AllItems.aspx"&gt;downloaded
form their web site&lt;/a&gt;. &lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style='font-size:10.0pt;font-family:Arial'&gt;One thing to note is that the tool
wraps the query XML nodes within a &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New"'&gt;&amp;lt;Query&amp;gt;&amp;lt;/Query&amp;gt;&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:Arial'&gt; node.&amp;nbsp;
You&amp;#8217;ll want to delete that node in your .NET code.&amp;nbsp; As a result, your CAML
query might look something like this:&amp;nbsp;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;b&gt;&lt;span style='font-size:8.0pt;font-family:"Courier New"'&gt;Dim strQueryDate as String
= Microsoft.SharePoint.Utilities.SPUtility.CreateISO8601DateTimeFromSystemDateTime(CDate(&amp;#8220;05/05/2006&amp;#8221;))&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;b&gt;&lt;span style='font-size:8.0pt;font-family:"Courier New"'&gt;Dim strQuery as String
= &amp;#8220;&amp;lt;Where&amp;gt;&amp;lt;Geq&amp;gt;&amp;lt;FieldRef Name=&amp;#8221;&amp;#8221;Created&amp;#8221;&amp;#8221;
/&amp;gt;&amp;lt;Value Type=&amp;#8221;&amp;#8221;DateTime&amp;#8221;&amp;#8221;&amp;gt;{0}&amp;lt;/Value&amp;gt;&amp;lt;/Geq&amp;gt;&amp;lt;/Where&amp;gt;&amp;#8221;,
strQueryDate)&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style='font-size:10.0pt;font-family:Arial;color:black'&gt;Note the goofy &lt;/span&gt;&lt;b&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New"'&gt;CreateISO8601DateTimeFromSystemDateTime&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:10.0pt;font-family:Arial;color:black'&gt; method
that is used for the date&amp;#8230; CAML uses an ISO8601 date format so you must use
this method if you want to do date comparisons.&lt;/span&gt;
&lt;/p&gt;
&lt;/div&gt;

</description>
      <comments>http://blog.toddtaylor.com/CommentView,guid,2506498b-7307-4714-9de9-aa961c56f402.aspx</comments>
      <category>VB.NET</category>
    </item>
    <item>
      <trackback:ping>http://blog.toddtaylor.com/Trackback.aspx?guid=c7e40b6c-eefd-43c5-8f7c-50fef3d2b9d0</trackback:ping>
      <pingback:server>http://blog.toddtaylor.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.toddtaylor.com/PermaLink,guid,c7e40b6c-eefd-43c5-8f7c-50fef3d2b9d0.aspx</pingback:target>
      <dc:creator>Todd M. Taylor</dc:creator>
      <wfw:comment>http://blog.toddtaylor.com/CommentView,guid,c7e40b6c-eefd-43c5-8f7c-50fef3d2b9d0.aspx</wfw:comment>
      <wfw:commentRss>http://blog.toddtaylor.com/SyndicationService.asmx/GetEntryCommentsRss?guid=c7e40b6c-eefd-43c5-8f7c-50fef3d2b9d0</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
To customize the default VB file templates used in Visual Studio .NET 2003, modify
the following files to your heart’s content:
</p>
        <p>
          <font face="Courier New">C:\Program Files\Microsoft Visual Studio .NET 2003\Vb7\VBWizards\DesignerTemplates\1033</font>
        </p>
      </body>
      <title>Customizing Visual Studio .NET 2003 VB Templates</title>
      <guid isPermaLink="false">http://blog.toddtaylor.com/PermaLink,guid,c7e40b6c-eefd-43c5-8f7c-50fef3d2b9d0.aspx</guid>
      <link>http://blog.toddtaylor.com/2006/03/17/CustomizingVisualStudioNET2003VBTemplates.aspx</link>
      <pubDate>Fri, 17 Mar 2006 22:52:32 GMT</pubDate>
      <description>&lt;p&gt;
To customize the default VB file templates used in Visual Studio .NET 2003, modify
the following files to your heart’s content:
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;C:\Program Files\Microsoft Visual Studio .NET 2003\Vb7\VBWizards\DesignerTemplates\1033&lt;/font&gt;
&lt;/p&gt;</description>
      <comments>http://blog.toddtaylor.com/CommentView,guid,c7e40b6c-eefd-43c5-8f7c-50fef3d2b9d0.aspx</comments>
      <category>ASP.NET</category>
      <category>VB.NET</category>
    </item>
    <item>
      <trackback:ping>http://blog.toddtaylor.com/Trackback.aspx?guid=b704c7fc-008a-4703-8340-14a1b2411d9d</trackback:ping>
      <pingback:server>http://blog.toddtaylor.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.toddtaylor.com/PermaLink,guid,b704c7fc-008a-4703-8340-14a1b2411d9d.aspx</pingback:target>
      <dc:creator>Todd M. Taylor</dc:creator>
      <wfw:comment>http://blog.toddtaylor.com/CommentView,guid,b704c7fc-008a-4703-8340-14a1b2411d9d.aspx</wfw:comment>
      <wfw:commentRss>http://blog.toddtaylor.com/SyndicationService.asmx/GetEntryCommentsRss?guid=b704c7fc-008a-4703-8340-14a1b2411d9d</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <strong>Abstract class</strong> – Defines the methods and common attributes of a set
of classes that are conceptually similar.  Abstract classes are never instantiated.
</p>
        <p>
          <b>Attribute</b> - Data associated with an object (also called a <i>data member</i>.)<br /></p>
        <p>
          <strong>Class</strong> – Blueprint of an object - defines the methods and data of
an object of its type.
</p>
        <p>
          <b>Constructor</b> - Procedure that is invoked when an object is created.<br /></p>
        <p>
          <strong>Concrete class</strong> – A class that implements a particular type of behavior
for an abstract class. Concrete classes are specific, non-changing implementations
of a concept.
</p>
        <p>
          <b>Derived Class</b> - A class that is specialized from a base class.  Contains
all of the attributes and methods of the base class but may also contain other attributes
or different method implimentations.
</p>
        <p>
          <b>Destructor</b> - Procedure that is invoked when a object is deleted.<br /></p>
        <p>
          <strong>Encapsulation</strong> – Typically defined as data hiding, but better thought
of as any kind of hiding (type, implementation, design, and so on.) Objects encapsulate
their data.  Abstract classes encapsulate their derived concrete classes.
</p>
        <p>
          <b>Functional Decomposition</b> - A method of analysis in which a problem is broken
into smaller and smaller functions.<br /></p>
        <p>
          <strong>Inheritance</strong> – A way that a class is specialized, used to relate derived
classes with their base classes. A class inherits from another class when it receives
some or all of the qualities of that class.  The starting class is called the <i>base</i>, <i>super</i>, <i>parent</i>,
or <i>generalized</i> class, whereas the inheriting class is called the <i>derived</i>, <i>sub</i>, <i>child</i>,
or <i>specialized</i> class.
</p>
        <p>
          <strong>Instance</strong> – A particular example of a class. (It is always an object.)
A particular instance or entity of a class.  Each object has its own state. 
This enables me to have several objects of the same type (class).
</p>
        <p>
          <strong>Instantiation</strong> – The process of creating an instance of a class.
</p>
        <p>
          <strong>Interface</strong> – An interface is like a class, but only provides a specification
– and not an implementation – for its members.  It is similar to an abstract
class consisting only of abstract members.  When programming, you use interfaces
when you need several classes to share some characteristics that are not present in
a common base class and want to be sure that each class implements the characteristic
on its own (because each member is abstract.)
</p>
        <p>
          <b>Member</b> - Either data ora procedure of a class.
</p>
        <p>
          <b>Method</b> - Procedures that are associated with a class.
</p>
        <p>
          <b>Object</b> - An entity with responsibilities.  A special, self-contained holder
of both data and procedures that operate on that data.  An object's data is protected
from external objects.<br /></p>
        <p>
          <strong>Perspectives</strong> – There are three different perspectives for looking
at objects: <i>conceptual</i>, <i>specification</i>, and <i>implementation</i>.  These
distinctions are helpful in understanding the relationship between abstract classes
and their derivations.  The abstract class defines how to solve things conceptually. 
It also gives the specification for communicating with any object derived from it.
Each derivation provides the specific implementation needed.
</p>
        <p>
          <strong>Polymorphism</strong> – Being able to refer to different derivations of a
class in the same way, but getting the behavior appropriate to the derived class being
referred to.
</p>
        <p>
          <b>Superclass</b> - A class from which other classes are derived. Contains the master
definitions of data nad procedures that all derived classes will use (and for procedures,
possibly override.)<br /></p>
      </body>
      <title>Object-Oriented Programming Terminology</title>
      <guid isPermaLink="false">http://blog.toddtaylor.com/PermaLink,guid,b704c7fc-008a-4703-8340-14a1b2411d9d.aspx</guid>
      <link>http://blog.toddtaylor.com/2006/02/15/ObjectOrientedProgrammingTerminology.aspx</link>
      <pubDate>Wed, 15 Feb 2006 21:39:36 GMT</pubDate>
      <description>&lt;p&gt;
&lt;strong&gt;Abstract class&lt;/strong&gt; – Defines the methods and common attributes of a set
of classes that are conceptually similar.&amp;nbsp; Abstract classes are never instantiated.
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;Attribute&lt;/b&gt; - Data associated with an object (also called a &lt;i&gt;data member&lt;/i&gt;.)&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Class&lt;/strong&gt; – Blueprint of an object - defines the methods and data of
an object of its type.
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;Constructor&lt;/b&gt; - Procedure that is invoked when an object is created.&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Concrete class&lt;/strong&gt; – A class that implements a particular type of behavior
for an abstract class. Concrete classes are specific, non-changing implementations
of a concept.
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;Derived Class&lt;/b&gt; - A class that is specialized from a base class.&amp;nbsp; Contains
all of the attributes and methods of the base class but may also contain other attributes
or different method implimentations.
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;Destructor&lt;/b&gt; - Procedure that is invoked when a object is deleted.&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Encapsulation&lt;/strong&gt; – Typically defined as data hiding, but better thought
of as any kind of hiding (type, implementation, design, and so on.) Objects encapsulate
their data.&amp;nbsp; Abstract classes encapsulate their derived concrete classes.
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;Functional Decomposition&lt;/b&gt; - A method of analysis in which a problem is broken
into smaller and smaller functions.&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Inheritance&lt;/strong&gt; – A way that a class is specialized, used to relate derived
classes with their base classes. A class inherits from another class when it receives
some or all of the qualities of that class. &amp;nbsp;The starting class is called the &lt;i&gt;base&lt;/i&gt;, &lt;i&gt;super&lt;/i&gt;, &lt;i&gt;parent&lt;/i&gt;,
or &lt;i&gt;generalized&lt;/i&gt; class, whereas the inheriting class is called the &lt;i&gt;derived&lt;/i&gt;, &lt;i&gt;sub&lt;/i&gt;, &lt;i&gt;child&lt;/i&gt;,
or &lt;i&gt;specialized&lt;/i&gt; class.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Instance&lt;/strong&gt; – A particular example of a class. (It is always an object.)
A particular instance or entity of a class.&amp;nbsp; Each object has its own state.&amp;nbsp;
This enables me to have several objects of the same type (class).
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Instantiation&lt;/strong&gt; – The process of creating an instance of a class.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Interface&lt;/strong&gt; – An interface is like a class, but only provides a specification
– and not an implementation – for its members. &amp;nbsp;It is similar to an abstract
class consisting only of abstract members. &amp;nbsp;When programming, you use interfaces
when you need several classes to share some characteristics that are not present in
a common base class and want to be sure that each class implements the characteristic
on its own (because each member is abstract.)
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;Member&lt;/b&gt; - Either data ora procedure of a class.
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;Method&lt;/b&gt; - Procedures that are associated with a class.
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;Object&lt;/b&gt; - An entity with responsibilities.&amp;nbsp; A special, self-contained holder
of both data and procedures that operate on that data.&amp;nbsp; An object's data is protected
from external objects.&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Perspectives&lt;/strong&gt; – There are three different perspectives for looking
at objects: &lt;i&gt;conceptual&lt;/i&gt;, &lt;i&gt;specification&lt;/i&gt;, and &lt;i&gt;implementation&lt;/i&gt;. &amp;nbsp;These
distinctions are helpful in understanding the relationship between abstract classes
and their derivations. &amp;nbsp;The abstract class defines how to solve things conceptually.&amp;nbsp;
It also gives the specification for communicating with any object derived from it.
Each derivation provides the specific implementation needed.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Polymorphism&lt;/strong&gt; – Being able to refer to different derivations of a
class in the same way, but getting the behavior appropriate to the derived class being
referred to.
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;Superclass&lt;/b&gt; - A class from which other classes are derived. Contains the master
definitions of data nad procedures that all derived classes will use (and for procedures,
possibly override.)&lt;br&gt;
&lt;/p&gt;</description>
      <comments>http://blog.toddtaylor.com/CommentView,guid,b704c7fc-008a-4703-8340-14a1b2411d9d.aspx</comments>
      <category>ASP.NET</category>
      <category>VB.NET</category>
    </item>
    <item>
      <trackback:ping>http://blog.toddtaylor.com/Trackback.aspx?guid=db14827e-c125-4780-8e5b-874dd726baad</trackback:ping>
      <pingback:server>http://blog.toddtaylor.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.toddtaylor.com/PermaLink,guid,db14827e-c125-4780-8e5b-874dd726baad.aspx</pingback:target>
      <dc:creator>Todd M. Taylor</dc:creator>
      <wfw:comment>http://blog.toddtaylor.com/CommentView,guid,db14827e-c125-4780-8e5b-874dd726baad.aspx</wfw:comment>
      <wfw:commentRss>http://blog.toddtaylor.com/SyndicationService.asmx/GetEntryCommentsRss?guid=db14827e-c125-4780-8e5b-874dd726baad</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div class="Section1">
          <p class="MsoNormal">
I recently took on the project of trying to create my own Business Logic Layer (BLL)
and Data Access Layer (DAL) in a personal web project so I could understand how the
various layers of n-tier architecture are supposed to work.  I didn’t get very
far before I realized that allowing NULL database values (<span style="FONT-FAMILY: 'Courier New'">System.DBNull.Value</span>)
in various fields in my database was going to give me a large headache :'(
</p>
          <p class="MsoNormal">
After doing a lot of research, I didn’t come-up with too many satisfactory methods
for dealing with <span style="FONT-FAMILY: 'Courier New'">DBNull</span>s.  At
best, it seemed like I’d have to write all sorts of methods for converting <span style="FONT-FAMILY: 'Courier New'">DBNull</span>s
to either a default value for each data type (I.e., define an integer to default to
zero, a string defaults to <span style="COLOR: blue; FONT-FAMILY: 'Courier New'">String</span><span style="FONT-FAMILY: 'Courier New'">.Empty</span>,
a date defaults to <span style="FONT-FAMILY: 'Courier New'">DateTime.MinValue</span>,
etc.) or use the new VB.NET 2.0 <a href="http://msdn2.microsoft.com/en-us/library/ms235245.aspx">Nullable
Types</a> and set each data type to <span style="COLOR: blue; FONT-FAMILY: 'Courier New'">Nothing</span>. 
This sounded like a lot of work and a lot of code… more code = more errors!
</p>
          <p class="MsoNormal">
I read a few articles on using <a href="http://msdn2.microsoft.com/en-us/library/w256ka79.aspx">Generic
Types in VB.NET 2.0</a> and it appeared to me as though they could be the answer to
my prayers:  Create one generic method that can check for <span style="FONT-FAMILY: 'Courier New'">DBNull</span>s
for all data types.  A <a href="http://dotnetjunkies.com/WebLog/saravana/archive/2005/05/14/76814.aspx">blog
post by Saravana Kumar</a> shows a way to accomplish this using C#. However, C# has
a keyword <span style="COLOR: blue; FONT-FAMILY: 'Courier New'"><a href="http://msdn2.microsoft.com/en-us/library/xwth0h0d.aspx">default</a></span>which
doesn’t exist in VB.NET (at least not that I could find.)  This keyword apparently
returns the default value for each data type, just like I wanted!
</p>
          <p class="MsoNormal">
After much tinkering, here is what I came-up after trying to convert Saravana’s code
to VB.NET:
</p>
          <p class="MsoNormal">
            <span style="COLOR: blue; FONT-FAMILY: 'Courier New'">Public</span>
            <span style="FONT-FAMILY: 'Courier New'">
              <span style="COLOR: blue">Shared</span>
              <span style="COLOR: blue">Function</span> ConvertDBNull(<span style="COLOR: blue">Of</span> T)(<span style="COLOR: blue">ByVal</span> obj <span style="COLOR: blue">As</span><span style="COLOR: blue">Object</span>) <span style="COLOR: blue">As</span> T<br /></span>
            <span style="FONT-FAMILY: 'Courier New'">    <span style="COLOR: blue">If</span> (obj <span style="COLOR: blue">Is</span> System.DBNull.Value) <span style="COLOR: blue">Then<br /></span></span>
            <span style="FONT-FAMILY: 'Courier New'">       
obj = <span style="COLOR: blue">Nothing<br /></span></span>
            <span style="FONT-FAMILY: 'Courier New'">    <span style="COLOR: blue">End</span><span style="COLOR: blue">If<br /></span></span>
            <span style="FONT-FAMILY: 'Courier New'">    <span style="COLOR: blue">Return</span><span style="COLOR: blue">CType</span>(obj,
T)<br /></span>
            <span style="COLOR: blue; FONT-FAMILY: 'Courier New'">End</span>
            <span style="FONT-FAMILY: 'Courier New'">
              <span style="COLOR: blue">Function</span>
            </span>
          </p>
          <p class="MsoNormal">
So far, it seems to work!  For example, with the following code:
</p>
          <p class="MsoNormal">
            <span style="COLOR: blue; FONT-FAMILY: 'Courier New'">Dim</span>
            <span style="FONT-FAMILY: 'Courier New'"> oSomeTestObject <span style="COLOR: blue">As</span><span style="COLOR: blue">Object</span> =
System.DBNull.Value<br /></span>
            <span style="COLOR: blue; FONT-FAMILY: 'Courier New'">Dim</span>
            <span style="FONT-FAMILY: 'Courier New'"> strResult <span style="COLOR: blue">As</span><span style="COLOR: blue">String</span> =
ConvertDBNull(<span style="COLOR: blue">Of</span><span style="COLOR: blue">Integer</span>)(oSomeTestObject)</span>
          </p>
          <p class="MsoNormal">
The value of <span style="FONT-FAMILY: 'Courier New'">strResult</span> is returned
as a zero.  Another example:<br /><br /><span style="COLOR: blue; FONT-FAMILY: 'Courier New'">Dim</span><span style="FONT-FAMILY: 'Courier New'"> oSomeTestObject <span style="COLOR: blue">As</span><span style="COLOR: blue">Object</span> =
System.DBNull.Value<br /></span><span style="COLOR: blue; FONT-FAMILY: 'Courier New'">Dim</span><span style="FONT-FAMILY: 'Courier New'"> strResult <span style="COLOR: blue">As</span><span style="COLOR: blue">String</span> =
ConvertDBNull(<span style="COLOR: blue">Of</span><span style="COLOR: blue">Date</span>)(oSomeTestObject)</span></p>
          <p class="MsoNormal">
The value of <span style="FONT-FAMILY: 'Courier New'">strResult</span> is returned
as a “12:00:00 AM”. For most dates that I display, I always format them as MM/dd/yyyy,
so a date value only exposing time won't show.
</p>
          <p class="MsoNormal">
I tested this new method on my BLL, and so far it works great! w00t! If you have
a better method for dealing with <span style="FONT-FAMILY: 'Courier New'">DBNull</span>s
in your Business Logic, let me know… I’m all ears!
</p>
        </div>
      </body>
      <title>Handling DbNulls in a Business Logic Layer with Generics</title>
      <guid isPermaLink="false">http://blog.toddtaylor.com/PermaLink,guid,db14827e-c125-4780-8e5b-874dd726baad.aspx</guid>
      <link>http://blog.toddtaylor.com/2005/11/29/HandlingDbNullsInABusinessLogicLayerWithGenerics.aspx</link>
      <pubDate>Tue, 29 Nov 2005 22:33:12 GMT</pubDate>
      <description>&lt;div class=Section1&gt;
&lt;p class=MsoNormal&gt;
I recently took on the project of trying to create my own Business Logic Layer (BLL)
and Data Access Layer (DAL) in a personal web project so I could understand how the
various layers of n-tier architecture are supposed to work.&amp;nbsp; I didn’t get very
far before I realized that allowing NULL database values (&lt;span style="FONT-FAMILY: 'Courier New'"&gt;System.DBNull.Value&lt;/span&gt;)
in various fields in my database was going to give me a large headache :'(
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
After doing a lot of research, I didn’t come-up with too many satisfactory methods
for dealing with &lt;span style="FONT-FAMILY: 'Courier New'"&gt;DBNull&lt;/span&gt;s.&amp;nbsp; At
best, it seemed like I’d have to write all sorts of methods for converting &lt;span style="FONT-FAMILY: 'Courier New'"&gt;DBNull&lt;/span&gt;s
to either a default value for each data type (I.e., define an integer to default to
zero, a string defaults to &lt;span style="COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;String&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'"&gt;.Empty&lt;/span&gt;,
a date defaults to &lt;span style="FONT-FAMILY: 'Courier New'"&gt;DateTime.MinValue&lt;/span&gt;,
etc.) or use the new VB.NET 2.0 &lt;a href="http://msdn2.microsoft.com/en-us/library/ms235245.aspx"&gt;Nullable
Types&lt;/a&gt; and set each data type to &lt;span style="COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;Nothing&lt;/span&gt;.&amp;nbsp;
This sounded like a lot of work and a lot of code… more code = more errors!
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
I read a few articles on using &lt;a href="http://msdn2.microsoft.com/en-us/library/w256ka79.aspx"&gt;Generic
Types in VB.NET 2.0&lt;/a&gt; and it appeared to me as though they could be the answer to
my prayers:&amp;nbsp; Create one generic method that can check for &lt;span style="FONT-FAMILY: 'Courier New'"&gt;DBNull&lt;/span&gt;s
for all data types.&amp;nbsp; A &lt;a href="http://dotnetjunkies.com/WebLog/saravana/archive/2005/05/14/76814.aspx"&gt;blog
post by Saravana Kumar&lt;/a&gt; shows a way to accomplish this using C#. However, C# has
a keyword &lt;span style="COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/xwth0h0d.aspx"&gt;default&lt;/a&gt; &lt;/span&gt;which
doesn’t exist in VB.NET (at least not that I could find.)&amp;nbsp; This keyword apparently
returns the default value for each data type, just like I wanted!
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
After much tinkering, here is what I came-up after trying to convert Saravana’s code
to VB.NET:
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;Public&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'"&gt; &lt;span style="COLOR: blue"&gt;Shared&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Function&lt;/span&gt; ConvertDBNull(&lt;span style="COLOR: blue"&gt;Of&lt;/span&gt; T)(&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt; obj &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Object&lt;/span&gt;) &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; T&lt;br&gt;
&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;If&lt;/span&gt; (obj &lt;span style="COLOR: blue"&gt;Is&lt;/span&gt; System.DBNull.Value) &lt;span style="COLOR: blue"&gt;Then&lt;br&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
obj = &lt;span style="COLOR: blue"&gt;Nothing&lt;br&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;If&lt;br&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;Return&lt;/span&gt; &lt;span style="COLOR: blue"&gt;CType&lt;/span&gt;(obj,
T)&lt;br&gt;
&lt;/span&gt;&lt;span style="COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;End&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'"&gt; &lt;span style="COLOR: blue"&gt;Function&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
So far, it seems to work!&amp;nbsp; For example, with the following code:
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;Dim&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'"&gt; oSomeTestObject &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Object&lt;/span&gt; =
System.DBNull.Value&lt;br&gt;
&lt;/span&gt;&lt;span style="COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;Dim&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'"&gt; strResult &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt; =
ConvertDBNull(&lt;span style="COLOR: blue"&gt;Of&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Integer&lt;/span&gt;)(oSomeTestObject)&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
The value of &lt;span style="FONT-FAMILY: 'Courier New'"&gt;strResult&lt;/span&gt; is returned
as a zero.&amp;nbsp; Another example:&lt;br&gt;
&lt;br&gt;
&lt;span style="COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;Dim&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'"&gt; oSomeTestObject &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Object&lt;/span&gt; =
System.DBNull.Value&lt;br&gt;
&lt;/span&gt;&lt;span style="COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;Dim&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'"&gt; strResult &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt; =
ConvertDBNull(&lt;span style="COLOR: blue"&gt;Of&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Date&lt;/span&gt;)(oSomeTestObject)&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
The value of &lt;span style="FONT-FAMILY: 'Courier New'"&gt;strResult&lt;/span&gt; is returned
as a “12:00:00 AM”. For most dates that I display, I always format them as MM/dd/yyyy,
so a date value only exposing time won't show.
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
I tested this new method on my BLL, and so far it works great!&amp;nbsp;w00t! If you have
a better method for dealing with &lt;span style="FONT-FAMILY: 'Courier New'"&gt;DBNull&lt;/span&gt;s
in your Business Logic, let me know… I’m all ears!
&lt;/p&gt;
&lt;/div&gt;</description>
      <comments>http://blog.toddtaylor.com/CommentView,guid,db14827e-c125-4780-8e5b-874dd726baad.aspx</comments>
      <category>ASP.NET</category>
      <category>VB.NET</category>
    </item>
    <item>
      <trackback:ping>http://blog.toddtaylor.com/Trackback.aspx?guid=268535fb-e22f-406b-a162-9f366720c7fd</trackback:ping>
      <pingback:server>http://blog.toddtaylor.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.toddtaylor.com/PermaLink,guid,268535fb-e22f-406b-a162-9f366720c7fd.aspx</pingback:target>
      <dc:creator>Todd M. Taylor</dc:creator>
      <wfw:comment>http://blog.toddtaylor.com/CommentView,guid,268535fb-e22f-406b-a162-9f366720c7fd.aspx</wfw:comment>
      <wfw:commentRss>http://blog.toddtaylor.com/SyndicationService.asmx/GetEntryCommentsRss?guid=268535fb-e22f-406b-a162-9f366720c7fd</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div class="Section1">
          <p class="MsoNormal">
The .NET 2.0 Framework supports a new string method for VB that should prove to be
useful:
</p>
          <span class="parameter">
            <span style="COLOR: #000066; FONT-FAMILY: 'Courier New'">
              <font size="2">
                <p>
returnValue = 
</p>
              </font>
              <font color="#0000ff" size="2">String</font>
              <font size="2">.IsNullOrEmpty(value)
</font>
            </span>
          </span>
          <p class="MsoNormal">
            <b>
              <span style="COLOR: black; FONT-FAMILY: Verdana">IsNullOrEmpty</span>
            </b>
            <span style="COLOR: black; FONT-FAMILY: Verdana"> is
a convenience method that enables you to simultaneously test whether a <b>String</b> is
a null reference (<b>Nothing</b> in Visual Basic) or its value is <b>Empty</b>.</span>
          </p>
          <p class="MsoNormal">
 
</p>
        </div>
      </body>
      <title>New Method for Checking Null or Empty Strings</title>
      <guid isPermaLink="false">http://blog.toddtaylor.com/PermaLink,guid,268535fb-e22f-406b-a162-9f366720c7fd.aspx</guid>
      <link>http://blog.toddtaylor.com/2005/11/22/NewMethodForCheckingNullOrEmptyStrings.aspx</link>
      <pubDate>Tue, 22 Nov 2005 19:37:43 GMT</pubDate>
      <description>&lt;div class=Section1&gt;
&lt;p class=MsoNormal&gt;
The .NET 2.0 Framework supports a new string method for VB that should prove to be
useful:
&lt;/p&gt;
&lt;span class=parameter&gt;&lt;span style="COLOR: #000066; FONT-FAMILY: 'Courier New'"&gt;&lt;font size=2&gt; 
&lt;p&gt;
returnValue = 
&lt;/font&gt;&lt;font color=#0000ff size=2&gt;String&lt;/font&gt;&lt;font size=2&gt;.IsNullOrEmpty(value)&gt;
&lt;/font&gt;&lt;/span&gt;&lt;/span&gt; 
&lt;p class=MsoNormal&gt;
&lt;b&gt;&lt;span style="COLOR: black; FONT-FAMILY: Verdana"&gt;IsNullOrEmpty&lt;/span&gt;&lt;/b&gt;&lt;span style="COLOR: black; FONT-FAMILY: Verdana"&gt; is
a convenience method that enables you to simultaneously test whether a &lt;b&gt;String&lt;/b&gt; is
a null reference (&lt;b&gt;Nothing&lt;/b&gt; in Visual Basic) or its value is &lt;b&gt;Empty&lt;/b&gt;.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;/div&gt;</description>
      <comments>http://blog.toddtaylor.com/CommentView,guid,268535fb-e22f-406b-a162-9f366720c7fd.aspx</comments>
      <category>ASP.NET</category>
      <category>VB.NET</category>
    </item>
    <item>
      <trackback:ping>http://blog.toddtaylor.com/Trackback.aspx?guid=2b81501a-a0f2-459e-a6b1-0360f6d75f8f</trackback:ping>
      <pingback:server>http://blog.toddtaylor.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.toddtaylor.com/PermaLink,guid,2b81501a-a0f2-459e-a6b1-0360f6d75f8f.aspx</pingback:target>
      <dc:creator>Todd M. Taylor</dc:creator>
      <wfw:comment>http://blog.toddtaylor.com/CommentView,guid,2b81501a-a0f2-459e-a6b1-0360f6d75f8f.aspx</wfw:comment>
      <wfw:commentRss>http://blog.toddtaylor.com/SyndicationService.asmx/GetEntryCommentsRss?guid=2b81501a-a0f2-459e-a6b1-0360f6d75f8f</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
When writing SQL statements, it's a good practice to always use "AS" after calling
each field. This will allow for column name changes that won't break your code. 
For example, the following is a simple SELECT statement:
</p>
        <p>
          <font face="Courier New">SELECT <em>Id</em> AS UserId, <em>FirstName</em> AS FirstName, <em>LastName</em> AS
LastName FROM Users</font>
        </p>
        <p>
If some of the column names change, such as the FirstName and LastName columns, my
code won't break:
</p>
        <p>
          <font face="Courier New">SELECT <em>Id</em> AS UserId, <em>FirstName</em> AS NameFirst, <em>NameLast</em> AS
LastName FROM Users</font>
        </p>
        <p>
Thanks to <a href="http://jelle.druyts.net/PermaLink.aspx?guid=61676665-06a7-443a-9462-71dae713539e">Jelle
Druyts</a> for this useful tip.
</p>
      </body>
      <title>Abstraction in SQL Queries</title>
      <guid isPermaLink="false">http://blog.toddtaylor.com/PermaLink,guid,2b81501a-a0f2-459e-a6b1-0360f6d75f8f.aspx</guid>
      <link>http://blog.toddtaylor.com/2005/11/21/AbstractionInSQLQueries.aspx</link>
      <pubDate>Mon, 21 Nov 2005 22:21:18 GMT</pubDate>
      <description>&lt;p&gt;
When writing SQL statements, it's a good practice to always use "AS" after calling
each field. This will allow for column name changes that won't break your code.&amp;nbsp;
For example, the following is a simple SELECT statement:
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;SELECT &lt;em&gt;Id&lt;/em&gt; AS UserId, &lt;em&gt;FirstName&lt;/em&gt; AS FirstName, &lt;em&gt;LastName&lt;/em&gt; AS
LastName FROM Users&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
If some of the column names change, such as the FirstName and LastName columns, my
code won't break:
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;SELECT &lt;em&gt;Id&lt;/em&gt; AS UserId, &lt;em&gt;FirstName&lt;/em&gt; AS NameFirst, &lt;em&gt;NameLast&lt;/em&gt; AS
LastName FROM Users&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
Thanks to &lt;a href="http://jelle.druyts.net/PermaLink.aspx?guid=61676665-06a7-443a-9462-71dae713539e"&gt;Jelle
Druyts&lt;/a&gt; for this useful tip.
&lt;/p&gt;</description>
      <comments>http://blog.toddtaylor.com/CommentView,guid,2b81501a-a0f2-459e-a6b1-0360f6d75f8f.aspx</comments>
      <category>ASP.NET</category>
      <category>SQL</category>
      <category>VB.NET</category>
    </item>
    <item>
      <trackback:ping>http://blog.toddtaylor.com/Trackback.aspx?guid=abb34908-4ce2-4466-8983-86c5138584d0</trackback:ping>
      <pingback:server>http://blog.toddtaylor.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.toddtaylor.com/PermaLink,guid,abb34908-4ce2-4466-8983-86c5138584d0.aspx</pingback:target>
      <dc:creator>Todd M. Taylor</dc:creator>
      <wfw:comment>http://blog.toddtaylor.com/CommentView,guid,abb34908-4ce2-4466-8983-86c5138584d0.aspx</wfw:comment>
      <wfw:commentRss>http://blog.toddtaylor.com/SyndicationService.asmx/GetEntryCommentsRss?guid=abb34908-4ce2-4466-8983-86c5138584d0</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div class="Section1">
          <p class="MsoNormal">
Who says that developers are boring and weird?  Well, they are weird, but sometimes
they can be fun:<br /><br /></p>
          <p class="MsoNormal">
            <a title="http://www.microsoft.com/korea/events/ready2005/vs_song.asp" href="http://www.microsoft.com/korea/events/ready2005/vs_song.asp">
              <img title="Visual Studio Team Systems Rap" height="190" alt="VSTSRap_small1.jpg" src="http://blog.toddtaylor.com/content/binary/VSTSRap_small1.jpg" width="321" border="0" />
            </a>
          </p>
          <p class="MsoNormal">
            <a href="http://www.microsoft.com/korea/events/ready2005/vs_song.asp">http://www.microsoft.com/korea/events/ready2005/vs_song.asp</a>
          </p>
          <p class="MsoNormal">
I’m not sure if I think the video is funny because of the content or because of the
Korean language that I don’t understand!
</p>
          <p class="MsoNormal">
The lyrics are very good too <a href="http://blogs.msdn.com/johnlawr/archive/2005/10/30/487021.aspx">when
translated into English</a>... they seem to relate to my job pretty well!
</p>
        </div>
      </body>
      <title>Visual Studio Team Systems Rap</title>
      <guid isPermaLink="false">http://blog.toddtaylor.com/PermaLink,guid,abb34908-4ce2-4466-8983-86c5138584d0.aspx</guid>
      <link>http://blog.toddtaylor.com/2005/11/11/VisualStudioTeamSystemsRap.aspx</link>
      <pubDate>Fri, 11 Nov 2005 21:12:22 GMT</pubDate>
      <description>&lt;div class=Section1&gt;
&lt;p class=MsoNormal&gt;
Who says that developers are boring and weird?&amp;nbsp; Well, they are weird, but sometimes
they can be fun:&lt;br&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;a title=http://www.microsoft.com/korea/events/ready2005/vs_song.asp href="http://www.microsoft.com/korea/events/ready2005/vs_song.asp"&gt;&lt;img title="Visual Studio Team Systems Rap" height=190 alt=VSTSRap_small1.jpg src="http://blog.toddtaylor.com/content/binary/VSTSRap_small1.jpg" width=321 border=0&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;a href="http://www.microsoft.com/korea/events/ready2005/vs_song.asp"&gt;http://www.microsoft.com/korea/events/ready2005/vs_song.asp&lt;/a&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
I’m not sure if I think the video is funny because of the content or because of the
Korean language that I don’t understand!
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
The lyrics are very good too &lt;a href="http://blogs.msdn.com/johnlawr/archive/2005/10/30/487021.aspx"&gt;when
translated into English&lt;/a&gt;... they seem to relate to my job pretty well!
&lt;/p&gt;
&lt;/div&gt;</description>
      <comments>http://blog.toddtaylor.com/CommentView,guid,abb34908-4ce2-4466-8983-86c5138584d0.aspx</comments>
      <category>ASP.NET</category>
      <category>VB.NET</category>
    </item>
    <item>
      <trackback:ping>http://blog.toddtaylor.com/Trackback.aspx?guid=578db981-72fe-427c-8848-ded5e459fbe1</trackback:ping>
      <pingback:server>http://blog.toddtaylor.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.toddtaylor.com/PermaLink,guid,578db981-72fe-427c-8848-ded5e459fbe1.aspx</pingback:target>
      <dc:creator>Todd M. Taylor</dc:creator>
      <wfw:comment>http://blog.toddtaylor.com/CommentView,guid,578db981-72fe-427c-8848-ded5e459fbe1.aspx</wfw:comment>
      <wfw:commentRss>http://blog.toddtaylor.com/SyndicationService.asmx/GetEntryCommentsRss?guid=578db981-72fe-427c-8848-ded5e459fbe1</wfw:commentRss>
      <slash:comments>3</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
It’s a sad day when a web developer like me has to resort to writing batch files. 
Since I had to write some today, I guess that makes this a sad day? ;-)
</p>
        <p>
Anyway, so I don’t forget, here is a sample script with some notes so I don’t completely
forget what I did.   The script below takes two file paths as input parameters,
then generates a file name using some date manipulation so that file may be moved
from the first file path to the second:
</p>
        <div class="code">
          <pre>rem Clear any previous commands
cls

rem Hide output from showing unless ECHO is used
@echo off rem Name: MoveIt.Bat

rem
rem Purpose: To copy a file from one directory to another.
rem The file name is dynamically created in this script.
rem
rem Variables:
rem %1 = The 'from' file path
rem %2 = The 'to' file path
rem 
rem Example:
rem 
rem C:\moveit.bat “C:\downloads\“ “C:\uploads\“
rem 
rem Create filename for last month's report PDF

set day=%date:~-7,2%
set month=%date:~-10,2%
set year=%date:~-2,2%

if %month:~-2,1% equ 0 set month=%month:~-1,1%
if %month% lss 1 goto error
if %month% gtr 12 goto error

set /a month=%month%-1

if %month% equ 0 set month=12
if %month% lss 10 set month=0%month%

set reportfile=SomeFileName %month%%year%.pdf
set reportpath=%1%reportfile%

rem Move the web report PDF from path %1 to %2
if not exist %reportpath% goto nofile
move %reportpath% %2

rem Create a text file for DIP importing
rem "&gt;" Over-writes the file, "&gt;&gt;" Appends to the file
set dipfile=%2WEBDIP.txt

rem Reset the dates in case they were modified above
set day=%date:~-10,2%
set month=%date:~-7,2%
set year=%date:~-4,4%
set currentdate=%day%/%month%/%year%

rem Write the DIP file directly in the %2 path
echo BEGIN &gt;&gt; %dipfile%
echo DOCTYPE: doctype &gt;&gt; %dipfile%
echo DATE: %currentdate% &gt;&gt; %dipfile%
echo PATH: %reportfile% &gt;&gt; %dipfile%
echo END &gt;&gt; %dipfile%

:error
if errorlevel 4 goto lowmemory 
if errorlevel 2 goto abort 
if errorlevel 0 goto exit 

:nofile
echo The requested PDF report (%reportfile%) was not found
goto exit

:lowmemory 
echo Insufficient memory to copy files or 
echo invalid drive or command-line syntax. 
goto exit

:abort 
echo You pressed CTRL+C to end the copy operation.
goto exit 

:exit
EXIT

rem Use ‘pause’ to prevent the DOS window from closing
rem pause</pre>
        </div>
        <p>
Note that this is my first batch file. If it's the worst thing you've ever seen, don't
just sit there, help me out! :-)
</p>
      </body>
      <title>Going Old-School with Batch Files</title>
      <guid isPermaLink="false">http://blog.toddtaylor.com/PermaLink,guid,578db981-72fe-427c-8848-ded5e459fbe1.aspx</guid>
      <link>http://blog.toddtaylor.com/2005/09/08/GoingOldSchoolWithBatchFiles.aspx</link>
      <pubDate>Thu, 08 Sep 2005 21:06:52 GMT</pubDate>
      <description>&lt;p&gt;
It’s a sad day when a web developer like me has to resort to writing batch files.&amp;nbsp;
Since I had to write some today, I guess that makes this a sad day? ;-)
&lt;/p&gt;
&lt;p&gt;
Anyway, so I don’t forget, here is a sample script with some notes so I don’t completely
forget what I did.&amp;nbsp;&amp;nbsp; The script below takes two file paths as input parameters,
then generates a file name using some date manipulation so that file may be moved
from the first file path to the second:
&lt;/p&gt;
&lt;div class=code&gt;&lt;pre&gt;rem Clear any previous commands
cls

rem Hide output from showing unless ECHO is used
@echo off rem Name: MoveIt.Bat

rem
rem Purpose: To copy a file from one directory to another.
rem The file name is dynamically created in this script.
rem
rem Variables:
rem %1 = The 'from' file path
rem %2 = The 'to' file path
rem 
rem Example:
rem 
rem C:\moveit.bat “C:\downloads\“ “C:\uploads\“
rem 
rem Create filename for last month's report PDF

set day=%date:~-7,2%
set month=%date:~-10,2%
set year=%date:~-2,2%

if %month:~-2,1% equ 0 set month=%month:~-1,1%
if %month% lss 1 goto error
if %month% gtr 12 goto error

set /a month=%month%-1

if %month% equ 0 set month=12
if %month% lss 10 set month=0%month%

set reportfile=SomeFileName %month%%year%.pdf
set reportpath=%1%reportfile%

rem Move the web report PDF from path %1 to %2
if not exist %reportpath% goto nofile
move %reportpath% %2

rem Create a text file for DIP importing
rem "&amp;gt;" Over-writes the file, "&amp;gt;&amp;gt;" Appends to the file
set dipfile=%2WEBDIP.txt

rem Reset the dates in case they were modified above
set day=%date:~-10,2%
set month=%date:~-7,2%
set year=%date:~-4,4%
set currentdate=%day%/%month%/%year%

rem Write the DIP file directly in the %2 path
echo BEGIN &amp;gt;&amp;gt; %dipfile%
echo DOCTYPE: doctype &amp;gt;&amp;gt; %dipfile%
echo DATE: %currentdate% &amp;gt;&amp;gt; %dipfile%
echo PATH: %reportfile% &amp;gt;&amp;gt; %dipfile%
echo END &amp;gt;&amp;gt; %dipfile%

:error
if errorlevel 4 goto lowmemory 
if errorlevel 2 goto abort 
if errorlevel 0 goto exit 

:nofile
echo The requested PDF report (%reportfile%) was not found
goto exit

:lowmemory 
echo Insufficient memory to copy files or 
echo invalid drive or command-line syntax. 
goto exit

:abort 
echo You pressed CTRL+C to end the copy operation.
goto exit 

:exit
EXIT

rem Use ‘pause’ to prevent the DOS window from closing
rem pause&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
Note that this is my first batch file. If it's the worst thing you've ever seen, don't
just sit there, help me out! :-)
&lt;/p&gt;</description>
      <comments>http://blog.toddtaylor.com/CommentView,guid,578db981-72fe-427c-8848-ded5e459fbe1.aspx</comments>
      <category>VB.NET</category>
    </item>
    <item>
      <trackback:ping>http://blog.toddtaylor.com/Trackback.aspx?guid=3522a02e-f505-4157-b85f-cc28e144fad7</trackback:ping>
      <pingback:server>http://blog.toddtaylor.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.toddtaylor.com/PermaLink,guid,3522a02e-f505-4157-b85f-cc28e144fad7.aspx</pingback:target>
      <dc:creator>Todd M. Taylor</dc:creator>
      <wfw:comment>http://blog.toddtaylor.com/CommentView,guid,3522a02e-f505-4157-b85f-cc28e144fad7.aspx</wfw:comment>
      <wfw:commentRss>http://blog.toddtaylor.com/SyndicationService.asmx/GetEntryCommentsRss?guid=3522a02e-f505-4157-b85f-cc28e144fad7</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div class="Section1">
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I’ve been told time and time again
that Microsoft’s Visual Source Safe 6.0 is not a very good application to use for
managing project files, but it’s all I have and it has been working pretty well… until
today.   One of my project folders apparently got corrupt; I couldn’t open
the folder, delete it, rename it… nuttin’.</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">After trying a gazillion stupid
things just short of creating a whole new VSS database and starting over, I finally
discovered the <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/guides/html/vsgrfss_analyze.asp">ANALYZE</a> command
line tool.  Sure enough, that’s all I needed to fix the corrupted database. 
The analyze tool is located in the </span>
            <b>
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">C:\Program
Files\Microsoft Visual Studio\VSS\win32</span>
            </b>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> folder.</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Running the following command was
all I had to do to fix the problematic folder:</span>
          </p>
          <p>
          </p>
          <pre>
            <b>
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">C:\Program Files\Microsoft
Visual Studio\VSS\win32&gt;ANALYZE –F \\server\vss\dbname\data</span>
            </b>
          </pre>
          <p>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Here is a list of a few other <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/guides/html/vsgrfss utilities.asp">VSS
Utilities</a>. Since I now know how to repair a corrupt VSS database, I’m going to
continue to ignore everyone’s advice and keep using VSS in the hopes that the 2005
version will be a cure-all (yah right!) </span>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Wingdings">J</span>
          </p>
        </div>
      </body>
      <title>Fixing a Corrupt Visual Source Safe (VSS) Database</title>
      <guid isPermaLink="false">http://blog.toddtaylor.com/PermaLink,guid,3522a02e-f505-4157-b85f-cc28e144fad7.aspx</guid>
      <link>http://blog.toddtaylor.com/2005/06/22/FixingACorruptVisualSourceSafeVSSDatabase.aspx</link>
      <pubDate>Wed, 22 Jun 2005 18:12:47 GMT</pubDate>
      <description>&lt;div class=Section1&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;I’ve been told time and time again
that Microsoft’s Visual Source Safe 6.0 is not a very good application to use for
managing project files, but it’s all I have and it has been working pretty well… until
today.&amp;nbsp;&amp;nbsp; One of my project folders apparently got corrupt; I couldn’t open
the folder, delete it, rename it… nuttin’.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;After trying a gazillion stupid
things just short of creating a whole new VSS database and starting over, I finally
discovered the &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/guides/html/vsgrfss_analyze.asp"&gt;ANALYZE&lt;/a&gt; command
line tool.&amp;nbsp; Sure enough, that’s all I needed to fix the corrupted database.&amp;nbsp;
The analyze tool is located in the &lt;/span&gt;&lt;b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;C:\Program
Files\Microsoft Visual Studio\VSS\win32&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt; folder.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Running the following command was
all I had to do to fix the problematic folder:&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;pre&gt;&lt;b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;C:\Program Files\Microsoft
Visual Studio\VSS\win32&amp;gt;ANALYZE –F \\server\vss\dbname\data&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Here is a list of a few other &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/guides/html/vsgrfss utilities.asp"&gt;VSS
Utilities&lt;/a&gt;. Since I now know how to repair a corrupt VSS database, I’m going to
continue to ignore everyone’s advice and keep using VSS in the hopes that the 2005
version will be a cure-all (yah right!) &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Wingdings"&gt;J&lt;/span&gt;
&lt;/p&gt;
&lt;/div&gt;</description>
      <comments>http://blog.toddtaylor.com/CommentView,guid,3522a02e-f505-4157-b85f-cc28e144fad7.aspx</comments>
      <category>ASP.NET</category>
      <category>VB.NET</category>
    </item>
    <item>
      <trackback:ping>http://blog.toddtaylor.com/Trackback.aspx?guid=0698a6a5-b076-4c66-9de7-58189c9877e3</trackback:ping>
      <pingback:server>http://blog.toddtaylor.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.toddtaylor.com/PermaLink,guid,0698a6a5-b076-4c66-9de7-58189c9877e3.aspx</pingback:target>
      <dc:creator>Todd M. Taylor</dc:creator>
      <wfw:comment>http://blog.toddtaylor.com/CommentView,guid,0698a6a5-b076-4c66-9de7-58189c9877e3.aspx</wfw:comment>
      <wfw:commentRss>http://blog.toddtaylor.com/SyndicationService.asmx/GetEntryCommentsRss?guid=0698a6a5-b076-4c66-9de7-58189c9877e3</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div class="Section1">
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">In case you didn’t already know,
you can run SQL scripts right within Visual Studio.NET which is much nicer than having
to fire-up Query Analyzer all of the time.<span style="COLOR: black">  This tutorial
assumes you already know what a Database project is in Visual Studio.</span></span>
          </p>
          <p class="MsoNormal">
            <b>
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Instructions:</span>
            </b>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">The first thing you must do is create
a </span>
            <b>
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">Database Reference</span>
            </b>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> in <span style="COLOR: black">your
database </span>project.<span style="COLOR: black"></span>In the Visual Studio Solution
Explorer, open the<span style="COLOR: black"> database </span>project and right click
on the </span>
            <b>
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">Database
References</span>
            </b>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> folder. 
Select </span>
            <b>
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">New Database
Reference…</span>
            </b>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> and the following
window should pop-up:</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
              <img height="308" src="http://blog.toddtaylor.com/content/binary/image0021.jpg" width="306" />
            </span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">If the database you’d like to connect
to is not listed, click </span>
            <b>
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">Add
New Reference…</span>
            </b>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> and you
will be prompted to setup a connection to the database of your choice.  Items
are added to this list via the </span>
            <b>
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">Server
Explorer</span>
            </b>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">.  </span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">You can add several database references
to a project.  I would suggest making a reference to your local, development
SQL database and one to the live web server’s SQL database.</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Once the database you’d like to
connect to is listed in the </span>
            <b>
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">Add
Database Reference</span>
            </b>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> list,
select it and click </span>
            <b>
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">OK</span>
            </b>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">. 
You notice that this reference is now listed under the </span>
            <b>
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">Database
Reference</span>
            </b>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> section in
the </span>
            <b>
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">Solution Explorer</span>
            </b>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">:</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
              <img height="233" src="http://blog.toddtaylor.com/content/binary/image00312.jpg" width="211" />
            </span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">If you have several databases listed,
you can right-click on the one you want as the default (usually your local SQL database)
and select </span>
            <b>
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">Set
as Project Default</span>
            </b>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">.</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">To run a SQL Script against a selected
database, right-click one of the SQL scripts stored in the database project and select </span>
            <b>
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">Run
On…</span>
            </b>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">  You’ll be prompted
with a window like this:</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
              <img height="308" src="http://blog.toddtaylor.com/content/binary/image005.jpg" width="306" />
            </span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Select the database you’d like to
run the script against, click </span>
            <b>
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">OK</span>
            </b>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">,
and the script runs!  Hopefully you’ll find this a useful and time-saving tip </span>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Wingdings">J</span>
          </p>
        </div>
      </body>
      <title>Running a SQL Script in VS.NET</title>
      <guid isPermaLink="false">http://blog.toddtaylor.com/PermaLink,guid,0698a6a5-b076-4c66-9de7-58189c9877e3.aspx</guid>
      <link>http://blog.toddtaylor.com/2005/04/30/RunningASQLScriptInVSNET.aspx</link>
      <pubDate>Sat, 30 Apr 2005 22:49:00 GMT</pubDate>
      <description>&lt;div class=Section1&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;In case you didn’t already know,
you can run SQL scripts right within Visual Studio.NET which is much nicer than having
to fire-up Query Analyzer all of the time.&lt;span style="COLOR: black"&gt;&amp;nbsp; This tutorial
assumes you already know what a Database project is in Visual Studio.&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Instructions:&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;The first thing you must do is create
a &lt;/span&gt;&lt;b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;Database Reference&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt; in &lt;span style="COLOR: black"&gt;your
database &lt;/span&gt;project.&lt;span style="COLOR: black"&gt; &lt;/span&gt;In the Visual Studio Solution
Explorer, open the&lt;span style="COLOR: black"&gt; database &lt;/span&gt;project and right click
on the &lt;/span&gt;&lt;b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;Database
References&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt; folder.&amp;nbsp;
Select &lt;/span&gt;&lt;b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;New Database
Reference…&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt; and the following
window should pop-up:&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;img height=308 src="http://blog.toddtaylor.com/content/binary/image0021.jpg" width=306&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;If the database you’d like to connect
to is not listed, click &lt;/span&gt;&lt;b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;Add
New Reference…&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt; and you
will be prompted to setup a connection to the database of your choice.&amp;nbsp; Items
are added to this list via the &lt;/span&gt;&lt;b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;Server
Explorer&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;.&amp;nbsp; &lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;You can add several database references
to a project.&amp;nbsp; I would suggest making a reference to your local, development
SQL database and one to the live web server’s SQL database.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Once the database you’d like to
connect to is listed in the &lt;/span&gt;&lt;b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;Add
Database Reference&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt; list,
select it and click &lt;/span&gt;&lt;b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;OK&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;.&amp;nbsp;
You notice that this reference is now listed under the &lt;/span&gt;&lt;b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;Database
Reference&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt; section in
the &lt;/span&gt;&lt;b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;Solution Explorer&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;:&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;img height=233 src="http://blog.toddtaylor.com/content/binary/image00312.jpg" width=211&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;If you have several databases listed,
you can right-click on the one you want as the default (usually your local SQL database)
and select &lt;/span&gt;&lt;b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;Set
as Project Default&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;To run a SQL Script against a selected
database, right-click one of the SQL scripts stored in the database project and select &lt;/span&gt;&lt;b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;Run
On…&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&amp;nbsp; You’ll be prompted
with a window like this:&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;img height=308 src="http://blog.toddtaylor.com/content/binary/image005.jpg" width=306&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Select the database you’d like to
run the script against, click &lt;/span&gt;&lt;b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;OK&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;,
and the script runs!&amp;nbsp; Hopefully you’ll find this a useful and time-saving tip &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Wingdings"&gt;J&lt;/span&gt;
&lt;/p&gt;
&lt;/div&gt;</description>
      <comments>http://blog.toddtaylor.com/CommentView,guid,0698a6a5-b076-4c66-9de7-58189c9877e3.aspx</comments>
      <category>ASP.NET</category>
      <category>VB.NET</category>
    </item>
    <item>
      <trackback:ping>http://blog.toddtaylor.com/Trackback.aspx?guid=6efea128-d037-4b4a-8b7b-61f684fbde15</trackback:ping>
      <pingback:server>http://blog.toddtaylor.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.toddtaylor.com/PermaLink,guid,6efea128-d037-4b4a-8b7b-61f684fbde15.aspx</pingback:target>
      <dc:creator>Todd M. Taylor</dc:creator>
      <wfw:comment>http://blog.toddtaylor.com/CommentView,guid,6efea128-d037-4b4a-8b7b-61f684fbde15.aspx</wfw:comment>
      <wfw:commentRss>http://blog.toddtaylor.com/SyndicationService.asmx/GetEntryCommentsRss?guid=6efea128-d037-4b4a-8b7b-61f684fbde15</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div class="Section1">
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">It seems easier than it is… looping
through an array of items (collection) and removing items you don’t want.  However,
when you remove an item from a collection while looping through it, the size of the
collection changes and the loop may fail… depending on how you are looping.</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">The correct way to loop through
a collection is to essentially loop through it backwards, starting with the item with
the maximum ID and working down to zero:</span>
          </p>
          <pre>
            <span style="FONT-FAMILY: 'Courier New'">
              <font color="#008080">    1</font> <font color="#0000ff"> For</font> i <font color="#0000ff">As
Integer</font> = MyList.Count - 1 <font color="#0000ff">To</font> 0 <font color="#0000ff">Step</font></span>
            <span> -1<br /><font color="#008080">    2</font> <font color="#0000ff">    
If</font> MyList.Items(i).Value &lt;&gt; SomeValue <font color="#0000ff">Then<br /></font><font color="#008080">    3</font>         
MyList.Remove(MyList(i))<br /><font color="#008080">    4</font> <font color="#0000ff">    
End If<br /></font><font color="#008080">    5</font> <font color="#0000ff"> Next</font></span>
          </pre>
        </div>
      </body>
      <title>Removing Items from a Collection</title>
      <guid isPermaLink="false">http://blog.toddtaylor.com/PermaLink,guid,6efea128-d037-4b4a-8b7b-61f684fbde15.aspx</guid>
      <link>http://blog.toddtaylor.com/2005/04/05/RemovingItemsFromACollection.aspx</link>
      <pubDate>Tue, 05 Apr 2005 23:46:49 GMT</pubDate>
      <description>&lt;div class=Section1&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;It seems easier than it is… looping
through an array of items (collection) and removing items you don’t want.&amp;nbsp; However,
when you remove an item from a collection while looping through it, the size of the
collection changes and the loop may fail… depending on how you are looping.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;The correct way to loop through
a collection is to essentially loop through it backwards, starting with the item with
the maximum ID and working down to zero:&lt;/span&gt;
&lt;/p&gt;
&lt;pre&gt;&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;font color=#008080&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&lt;/font&gt;&amp;nbsp;&lt;font color=#0000ff&gt;&amp;nbsp;For&lt;/font&gt; i &lt;font color=#0000ff&gt;As
Integer&lt;/font&gt; = MyList.Count - 1 &lt;font color=#0000ff&gt;To&lt;/font&gt; 0 &lt;font color=#0000ff&gt;Step&lt;/font&gt;&lt;/span&gt;&lt;span&gt; -1&lt;br&gt;
&lt;font color=#008080&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2&lt;/font&gt;&amp;nbsp;&lt;font color=#0000ff&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
If&lt;/font&gt; MyList.Items(i).Value &amp;lt;&amp;gt; SomeValue &lt;font color=#0000ff&gt;Then&lt;br&gt;
&lt;/font&gt;&lt;font color=#008080&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
MyList.Remove(MyList(i))&lt;br&gt;
&lt;font color=#008080&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4&lt;/font&gt;&amp;nbsp;&lt;font color=#0000ff&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
End If&lt;br&gt;
&lt;/font&gt;&lt;font color=#008080&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;5&lt;/font&gt;&amp;nbsp;&lt;font color=#0000ff&gt;&amp;nbsp;Next&lt;/font&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;</description>
      <comments>http://blog.toddtaylor.com/CommentView,guid,6efea128-d037-4b4a-8b7b-61f684fbde15.aspx</comments>
      <category>ASP.NET</category>
      <category>VB.NET</category>
    </item>
    <item>
      <trackback:ping>http://blog.toddtaylor.com/Trackback.aspx?guid=8ed8dce7-2ef8-4567-a38e-5b2f97eef2b8</trackback:ping>
      <pingback:server>http://blog.toddtaylor.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.toddtaylor.com/PermaLink,guid,8ed8dce7-2ef8-4567-a38e-5b2f97eef2b8.aspx</pingback:target>
      <dc:creator>Todd M. Taylor</dc:creator>
      <wfw:comment>http://blog.toddtaylor.com/CommentView,guid,8ed8dce7-2ef8-4567-a38e-5b2f97eef2b8.aspx</wfw:comment>
      <wfw:commentRss>http://blog.toddtaylor.com/SyndicationService.asmx/GetEntryCommentsRss?guid=8ed8dce7-2ef8-4567-a38e-5b2f97eef2b8</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div class="Section1">
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Admit it, you do it to.  You
can’t remember the .NET way to do something, so you give-in and put </span>
            <span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">Imports</span>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> Microsoft.VisualBasic </span>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">at
the top of your .vb file.  It’s time to stop the madness! Where there is help,
there is hope.</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">As of recently, a co-worker explained
to me the virtues of not using the old-school VB namespace in favor of learning the
newer VB.NET way of doing things.  One of the benefits is that VB.NET code is
typically optimized to run faster… and we all love <i>speed</i>, don’t we?    There
were two places in particular that I kept resorting to the old VB way: date manipulation
and formatting.</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">For example, here is the old VB
way to add 7 days to the current date:</span>
          </p>
          <pre>
            <p class="MsoNormal">
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">DateAdd(DateInterval.Day,
7, <span style="COLOR: blue">Date</span>.Now)</span>
            </p>
          </pre>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">And here is the VB.NET way:</span>
          </p>
          <pre>
            <p class="MsoNormal">
              <span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">Date</span>
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">.Now.AddDays(7)</span>
            </p>
          </pre>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">That’s not so bad, is it? Now let’s
look at formatting.  Sure, there are quite a few ways to do the same thing, but
here’s an example.   If you want to format a date type variable in VB:</span>
          </p>
          <pre>
            <p class="MsoNormal">
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">Format(<span style="COLOR: blue">Date</span>.Now.ToString, <span style="COLOR: fuchsia">"MM/dd/yyyy"</span>) </span>
            </p>
          </pre>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">… or …</span>
          </p>
          <pre>
            <p class="MsoNormal">
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">FormatDateTime(<span style="COLOR: blue">Date</span>.Now,
DateFormat.ShortDate)</span>
            </p>
          </pre>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">And in VB.NET:</span>
          </p>
          <pre>
            <p class="MsoNormal">
              <span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">Date</span>
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">.Now.ToString(<span style="COLOR: fuchsia">"MM/dd/yyyy"</span>)</span>
            </p>
          </pre>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Actually, the VB.NET way seems easier!
I wish I would’ve explored the VB.NET method sooner. </span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Here's some more handy conversions:</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">To subtract to dates:</span>
          </p>
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
            <div class="cf">
              <pre class="cl">
                <span class="cb1">
                  <font color="#0000ff">Dim</font>
                </span>
                <span> dblDateDiff </span>
                <font color="#0000ff">
                  <span class="cb1">As</span>
                  <span class="cb1"> Double</span>
                </font>
                <span> =
datEndDate.Subtract(datStartDate).Days</span>
              </pre>
            </div>
          </span>
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
            <!--EndFragment-->
          </span>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">So far, I’ve only come across one
VB function (but I’m sure there are more) that I haven’t been able to find a VB.NET
replacement for: </span>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">vbTab</span>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">. 
I found the replacement for </span>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">vbCrLf</span>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> is </span>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">Environment.NewLine</span>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> (one
of the new VB.NET classes that is actually less convenient than its VB counterpart),
but I have yet to find a way to put a simple tab space into a string.  Not a
huge problem, but odd in my opinion since that means I can’t completely lay the Visual
Basic namespace to rest!</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">To help yourself cure your addiction
to Visual Basic (the old-school kind), set the filter in the Microsoft Visual Studio.NET
2003 Documentation library to ‘.NET Framework’ instead of ‘Visual Basic’.  I
was under the impression that the ‘Visual Basic’ filter <i>meant</i> VB.NET, but it
does not.</span>
          </p>
        </div>
      </body>
      <title>Weaning Myself Off the Visual Basic Namespace</title>
      <guid isPermaLink="false">http://blog.toddtaylor.com/PermaLink,guid,8ed8dce7-2ef8-4567-a38e-5b2f97eef2b8.aspx</guid>
      <link>http://blog.toddtaylor.com/2005/02/15/WeaningMyselfOffTheVisualBasicNamespace.aspx</link>
      <pubDate>Tue, 15 Feb 2005 14:48:04 GMT</pubDate>
      <description>&lt;div class=Section1&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Admit it, you do it to.&amp;nbsp; You
can’t remember the .NET way to do something, so you give-in and put &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;Imports&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; Microsoft.VisualBasic &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;at
the top of your .vb file.&amp;nbsp; It’s time to stop the madness! Where there is help,
there is hope.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;As of recently, a co-worker explained
to me the virtues of not using the old-school VB namespace in favor of learning the
newer VB.NET way of doing things.&amp;nbsp; One of the benefits is that VB.NET code is
typically optimized to run faster… and we all love &lt;i&gt;speed&lt;/i&gt;, don’t we?&amp;nbsp; &amp;nbsp;&amp;nbsp;There
were two places in particular that I kept resorting to the old VB way: date manipulation
and formatting.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;For example, here is the old VB
way to add 7 days to the current date:&lt;/span&gt;
&lt;/p&gt;
&lt;pre&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;DateAdd(DateInterval.Day,
7, &lt;span style="COLOR: blue"&gt;Date&lt;/span&gt;.Now)&lt;/span&gt;
&lt;/p&gt;
&lt;/pre&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;And here is the VB.NET way:&lt;/span&gt;
&lt;/p&gt;
&lt;pre&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;Date&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;.Now.AddDays(7)&lt;/span&gt;
&lt;/p&gt;
&lt;/pre&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;That’s not so bad, is it? Now let’s
look at formatting.&amp;nbsp; Sure, there are quite a few ways to do the same thing, but
here’s an example.&amp;nbsp;&amp;nbsp; If you want to format a date type variable in VB:&lt;/span&gt;
&lt;/p&gt;
&lt;pre&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;Format(&lt;span style="COLOR: blue"&gt;Date&lt;/span&gt;.Now.ToString, &lt;span style="COLOR: fuchsia"&gt;"MM/dd/yyyy"&lt;/span&gt;) &lt;/span&gt;
&lt;/p&gt;
&lt;/pre&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;… or …&lt;/span&gt;
&lt;/p&gt;
&lt;pre&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;FormatDateTime(&lt;span style="COLOR: blue"&gt;Date&lt;/span&gt;.Now,
DateFormat.ShortDate)&lt;/span&gt;
&lt;/p&gt;
&lt;/pre&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;And in VB.NET:&lt;/span&gt;
&lt;/p&gt;
&lt;pre&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;Date&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;.Now.ToString(&lt;span style="COLOR: fuchsia"&gt;"MM/dd/yyyy"&lt;/span&gt;)&lt;/span&gt;
&lt;/p&gt;
&lt;/pre&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Actually, the VB.NET way seems easier!
I wish I would’ve explored the VB.NET method sooner. &lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Here's some more handy conversions:&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;To subtract to dates:&lt;/span&gt;
&lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt; 
&lt;div class=cf&gt;&lt;pre class=cl&gt;&lt;span class=cb1&gt;&lt;font color=#0000ff&gt;Dim&lt;/font&gt;&lt;/span&gt;&lt;span&gt; dblDateDiff &lt;/span&gt;&lt;font color=#0000ff&gt;&lt;span class=cb1&gt;As&lt;/span&gt;&lt;span class=cb1&gt; Double&lt;/span&gt;&lt;/font&gt;&lt;span&gt; =
datEndDate.Subtract(datStartDate).Days&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;
&lt;!--EndFragment--&gt;&lt;/span&gt; 
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;So far, I’ve only come across one
VB function (but I’m sure there are more) that I haven’t been able to find a VB.NET
replacement for: &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;vbTab&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;.&amp;nbsp;
I found the replacement for &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;vbCrLf&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt; is &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;Environment.NewLine&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt; (one
of the new VB.NET classes that is actually less convenient than its VB counterpart),
but I have yet to find a way to put a simple tab space into a string.&amp;nbsp; Not a
huge problem, but odd in my opinion since that means I can’t completely lay the Visual
Basic namespace to rest!&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;To help yourself cure your addiction
to Visual Basic (the old-school kind), set the filter in the Microsoft Visual Studio.NET
2003 Documentation library to ‘.NET Framework’ instead of ‘Visual Basic’.&amp;nbsp; I
was under the impression that the ‘Visual Basic’ filter &lt;i&gt;meant&lt;/i&gt; VB.NET, but it
does not.&lt;/span&gt;
&lt;/p&gt;
&lt;/div&gt;</description>
      <comments>http://blog.toddtaylor.com/CommentView,guid,8ed8dce7-2ef8-4567-a38e-5b2f97eef2b8.aspx</comments>
      <category>ASP.NET</category>
      <category>VB.NET</category>
    </item>
    <item>
      <trackback:ping>http://blog.toddtaylor.com/Trackback.aspx?guid=490cb24f-1438-4f57-b47e-5ac5321cb6c3</trackback:ping>
      <pingback:server>http://blog.toddtaylor.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.toddtaylor.com/PermaLink,guid,490cb24f-1438-4f57-b47e-5ac5321cb6c3.aspx</pingback:target>
      <dc:creator>Todd M. Taylor</dc:creator>
      <wfw:comment>http://blog.toddtaylor.com/CommentView,guid,490cb24f-1438-4f57-b47e-5ac5321cb6c3.aspx</wfw:comment>
      <wfw:commentRss>http://blog.toddtaylor.com/SyndicationService.asmx/GetEntryCommentsRss?guid=490cb24f-1438-4f57-b47e-5ac5321cb6c3</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://www.software-answers.com/Training/Certification/mcadpath.htm">
            <img style="WIDTH: 112px; HEIGHT: 52px" alt="Microsoft Certified Application Developer" hspace="10" src="http://blog.toddtaylor.com/content/binary/MCADRGB_112_52.gif" align="left" vspace="10" border="0" />
          </a>
          <font face="Arial" size="2">Yippee! 
After studying for the <a href="http://www.microsoft.com/learning/exams/70-310.asp">70-310
exam</a> (XML Web Services and Server Components using VB.NET) for months, I
took it this morning for the first time and passed!   </font>
        </p>
        <p>
          <font face="Arial" size="2">This is the third Microsoft exam I've taken, so that bumps
me up to the <a href="http://www.microsoft.com/learning/mcp/mcad/default.asp">MCAD.NET</a> status.  
To me, the exam was really tough... the toughest so far.  I've taken the <a href="http://www.microsoft.com/learning/exams/70-229.asp">70-229</a> exam (SQL
Server) and <a href="http://www.microsoft.com/learning/exams/70-305.asp">70-305</a> exam (VB.NET
Web Apps) previously and although they were challenging, I had more experience to
back my studying for those two tests.   As of yet, I've only used web services
minimally and I've never had to create or use a service component.  Despite my
lack of current experience with XML web services and server controls, I opted to take
the 70-310 because I feel that applications such as Microsoft BizTalk Server will
be more and more important in the future as the need to exchange data between desperate
systems becomes crucial to being competitive in the business world.<br /><br />
To get my <a href="http://www.microsoft.com/learning/mcp/mcsd/default.asp">MSCD.NET</a> certification,
my next exam will be the <a href="http://www.microsoft.com/learning/exams/70-300.asp">70-300</a> exam
(Analyzing Requirements and Defining Solution Architectures), followed by the <a href="http://www.microsoft.com/learning/exams/70-306.asp">70-306</a> (Windows-Based
Apps w/ VB.NET).</font>
        </p>
      </body>
      <title>I'm Now a MCAD.NET Geek!</title>
      <guid isPermaLink="false">http://blog.toddtaylor.com/PermaLink,guid,490cb24f-1438-4f57-b47e-5ac5321cb6c3.aspx</guid>
      <link>http://blog.toddtaylor.com/2005/01/19/ImNowAMCADNETGeek.aspx</link>
      <pubDate>Wed, 19 Jan 2005 18:45:03 GMT</pubDate>
      <description>&lt;p&gt;
&lt;a href="http://www.software-answers.com/Training/Certification/mcadpath.htm"&gt;&lt;img style="WIDTH: 112px; HEIGHT: 52px" alt="Microsoft Certified Application Developer" hspace=10 src="http://blog.toddtaylor.com/content/binary/MCADRGB_112_52.gif" align=left vspace=10 border=0&gt;&lt;/a&gt;&lt;font face=Arial size=2&gt;Yippee!&amp;nbsp;
After studying for the &lt;a href="http://www.microsoft.com/learning/exams/70-310.asp"&gt;70-310
exam&lt;/a&gt; (XML Web Services and&amp;nbsp;Server Components using VB.NET) for months, I
took it this morning for the first time and passed!&amp;nbsp;&amp;nbsp; &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial size=2&gt;This is the third Microsoft exam I've taken, so that bumps
me up to the &lt;a href="http://www.microsoft.com/learning/mcp/mcad/default.asp"&gt;MCAD.NET&lt;/a&gt; status.&amp;nbsp;&amp;nbsp;
To me, the exam was really tough... the toughest so far.&amp;nbsp; I've taken the &lt;a href="http://www.microsoft.com/learning/exams/70-229.asp"&gt;70-229&lt;/a&gt; exam&amp;nbsp;(SQL
Server) and &lt;a href="http://www.microsoft.com/learning/exams/70-305.asp"&gt;70-305&lt;/a&gt; exam&amp;nbsp;(VB.NET
Web Apps) previously and although they were challenging, I had more experience to
back my studying for those two tests.&amp;nbsp;&amp;nbsp; As of yet, I've only used web services
minimally and I've never had to create or use a service component.&amp;nbsp; Despite my
lack of current experience with XML web services and server controls, I opted to take
the 70-310 because I feel that applications such as Microsoft BizTalk Server will
be more and more important in the future as the need to exchange data between desperate
systems becomes crucial to being competitive in the business world.&lt;br&gt;
&lt;br&gt;
To get my &lt;a href="http://www.microsoft.com/learning/mcp/mcsd/default.asp"&gt;MSCD.NET&lt;/a&gt; certification,
my next exam will be the &lt;a href="http://www.microsoft.com/learning/exams/70-300.asp"&gt;70-300&lt;/a&gt; exam
(Analyzing Requirements and Defining Solution Architectures), followed by the &lt;a href="http://www.microsoft.com/learning/exams/70-306.asp"&gt;70-306&lt;/a&gt; (Windows-Based
Apps w/ VB.NET).&lt;/font&gt;
&lt;/p&gt;</description>
      <comments>http://blog.toddtaylor.com/CommentView,guid,490cb24f-1438-4f57-b47e-5ac5321cb6c3.aspx</comments>
      <category>ASP.NET</category>
      <category>VB.NET</category>
    </item>
  </channel>
</rss>