<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" 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:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>.NET Framework</title>
        <link>http://geekswithblogs.net/LifeLongTechie/category/11255.aspx</link>
        <description>.NET Framework</description>
        <language>en-US</language>
        <copyright>Kevin Shyr</copyright>
        <managingEditor>kevinshyr@gmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>Windows Azure Tables notes</title>
            <link>http://geekswithblogs.net/LifeLongTechie/archive/2011/05/05/windows-azure-tables-notes.aspx</link>
            <description>&lt;p&gt;Notes from camp:  &lt;a href="http://wabcdemos.cloudapp.net/"&gt;http://wabcdemos.cloudapp.net/&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;CreateCloudTableClient()&lt;br /&gt;
    CreateIfNotExists&lt;br /&gt;
    DeleteIfExists&lt;br /&gt;
     &lt;/li&gt;
    &lt;li&gt;CreateTable&lt;br /&gt;
    Create Partition Key (don't use identity key as partition key)&lt;br /&gt;
    Create Row Key, must be unique per PartitionKey&lt;br /&gt;
    Use a lightweight copy to improve performance&lt;br /&gt;
     &lt;/li&gt;
    &lt;li&gt;Use "batching" to increase performance, and also save money by reducing the number of transaction&lt;br /&gt;
    For example, ???Context.SaveChanges(SaveChangesOptions.Batch);&lt;br /&gt;
     &lt;/li&gt;
    &lt;li&gt;Queries&lt;br /&gt;
    Over 30 second is cancelled&lt;br /&gt;
    result &amp;gt; 1000, a continuation token is returned&lt;br /&gt;
     &lt;/li&gt;
    &lt;li&gt;Transaction&lt;br /&gt;
    Limit 100 per batch&lt;br /&gt;
     &lt;/li&gt;
    &lt;li&gt;Column limit: 260 (URI length)&lt;br /&gt;
     &lt;/li&gt;
    &lt;li&gt;Data transfer: only counts the transfer in/out of data center (not within data center)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;/p&gt; &lt;img src="http://geekswithblogs.net/LifeLongTechie/aggbug/145187.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Kevin Shyr</dc:creator>
            <guid>http://geekswithblogs.net/LifeLongTechie/archive/2011/05/05/windows-azure-tables-notes.aspx</guid>
            <pubDate>Thu, 05 May 2011 14:03:06 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/LifeLongTechie/comments/145187.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/LifeLongTechie/archive/2011/05/05/windows-azure-tables-notes.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/LifeLongTechie/comments/commentRss/145187.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/LifeLongTechie/services/trackbacks/145187.aspx</trackback:ping>
        </item>
        <item>
            <title>Code Certificate</title>
            <link>http://geekswithblogs.net/LifeLongTechie/archive/2011/03/31/code-certificate.aspx</link>
            <description>&lt;p&gt;http://www.startssl.com/&lt;/p&gt; &lt;img src="http://geekswithblogs.net/LifeLongTechie/aggbug/144620.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Kevin Shyr</dc:creator>
            <guid>http://geekswithblogs.net/LifeLongTechie/archive/2011/03/31/code-certificate.aspx</guid>
            <pubDate>Thu, 31 Mar 2011 17:39:45 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/LifeLongTechie/comments/144620.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/LifeLongTechie/archive/2011/03/31/code-certificate.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/LifeLongTechie/comments/commentRss/144620.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/LifeLongTechie/services/trackbacks/144620.aspx</trackback:ping>
        </item>
        <item>
            <title>Starting PowerShell learning process</title>
            <link>http://geekswithblogs.net/LifeLongTechie/archive/2011/03/31/starting-powershell-learning-process.aspx</link>
            <description>&lt;p&gt;Today I start learning powershell, maybe 2 years too late!&lt;/p&gt;
&lt;p&gt;http://powershell.com/cs/&lt;/p&gt;
&lt;p&gt;http://www.powergui.org/index.jspa&lt;/p&gt;
&lt;p&gt;http://poshcode.org/&lt;/p&gt; &lt;img src="http://geekswithblogs.net/LifeLongTechie/aggbug/144618.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Kevin Shyr</dc:creator>
            <guid>http://geekswithblogs.net/LifeLongTechie/archive/2011/03/31/starting-powershell-learning-process.aspx</guid>
            <pubDate>Thu, 31 Mar 2011 17:31:46 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/LifeLongTechie/comments/144618.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/LifeLongTechie/archive/2011/03/31/starting-powershell-learning-process.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/LifeLongTechie/comments/commentRss/144618.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/LifeLongTechie/services/trackbacks/144618.aspx</trackback:ping>
        </item>
        <item>
            <title>Parallel programming in Visual Studio</title>
            <link>http://geekswithblogs.net/LifeLongTechie/archive/2011/03/31/parallel-programming-in-visual-studio.aspx</link>
            <description>&lt;p&gt;Not much experience with these products yet.&lt;/p&gt;
&lt;p&gt;Free:  http://developer.nvidia.com/object/nsight.html&lt;/p&gt;
&lt;p&gt;Not free:  http://software.intel.com/en-us/articles/intel-parallel-studio-purchase/&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;For SSIS, this looks very interesting:&lt;/p&gt;
&lt;p&gt;http://extendedssispkgexec.codeplex.com/&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt; &lt;img src="http://geekswithblogs.net/LifeLongTechie/aggbug/144617.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Kevin Shyr</dc:creator>
            <guid>http://geekswithblogs.net/LifeLongTechie/archive/2011/03/31/parallel-programming-in-visual-studio.aspx</guid>
            <pubDate>Thu, 31 Mar 2011 17:26:03 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/LifeLongTechie/comments/144617.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/LifeLongTechie/archive/2011/03/31/parallel-programming-in-visual-studio.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/LifeLongTechie/comments/commentRss/144617.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/LifeLongTechie/services/trackbacks/144617.aspx</trackback:ping>
        </item>
        <item>
            <title>Using BizTalk to bridge SQL Job and Human Intervention (Requesting Permission)</title>
            <link>http://geekswithblogs.net/LifeLongTechie/archive/2011/02/04/using-biztalk-to-bridge-sql-job-and-human-intervention-requesting.aspx</link>
            <description>&lt;p&gt;I start off the process with either a BizTalk Scheduler (http://biztalkscheduledtask.codeplex.com/releases/view/50363) or a manual file drop of the XML message.  The manual file drop is to allow the SQL &lt;/p&gt;
&lt;p&gt;Job to call a "File Copy" SSIS step to copy the trigger file for the next process and allows SQL &lt;/p&gt;
&lt;p&gt;Job to be linked back into BizTalk processing.&lt;/p&gt;
&lt;p&gt;The Process Trigger XML looks like the following.  It is basically the configuration hub of the business process&lt;/p&gt;
&lt;p&gt;&amp;lt;ns0:MsgSchedulerTriggerSQLJobReceive xmlns:ns0="urn:com:something something"&amp;gt;&lt;br /&gt;
  &amp;lt;ns0:IsProcessAsync&amp;gt;YES&amp;lt;/ns0:IsProcessAsync&amp;gt;&lt;br /&gt;
  &amp;lt;ns0:IsPermissionRequired&amp;gt;YES&amp;lt;/ns0:IsPermissionRequired&amp;gt;&lt;br /&gt;
  &amp;lt;ns0:BusinessProcessName&amp;gt;Data Push&amp;lt;/ns0:BusinessProcessName&amp;gt; &lt;br /&gt;
  &amp;lt;ns0:EmailFrom&amp;gt;DoNotReply@company.com&amp;lt;/ns0:EmailFrom&amp;gt;&lt;br /&gt;
  &amp;lt;ns0:EmailRecipientToList&amp;gt;ProjectManagers@company.com&amp;lt;/ns0:EmailRecipientToList&amp;gt;&lt;br /&gt;
  &amp;lt;ns0:EmailRecipientCCList&amp;gt;Developers@company.com&amp;lt;/ns0:EmailRecipientCCList&amp;gt;&lt;br /&gt;
  &amp;lt;ns0:EmailMessageBodyForPermissionRequest&amp;gt;This message was sent to request permission to start the Data Push process.  The SQL Job to be run is WeeklyProcessing_DataPush&amp;lt;/ns0:EmailMessageBodyForPermissionRequest&amp;gt;&lt;br /&gt;
  &amp;lt;ns0:SQLJobName&amp;gt;WeeklyProcessing_DataPush&amp;lt;/ns0:SQLJobName&amp;gt;&lt;br /&gt;
  &amp;lt;ns0:SQLJobStepName&amp;gt;Push_To_Production&amp;lt;/ns0:SQLJobStepName&amp;gt;&lt;br /&gt;
  &amp;lt;ns0:SQLJobMinToWait&amp;gt;1&amp;lt;/ns0:SQLJobMinToWait&amp;gt;&lt;br /&gt;
  &amp;lt;ns0:PermissionRequestTriggerPath&amp;gt;\\server\ETL-BizTalk\Automation\TriggerCreatedByBizTalk\&amp;lt;/ns0:PermissionRequestTriggerPath&amp;gt;&lt;br /&gt;
  &amp;lt;ns0:PermissionRequestApprovedPath&amp;gt;\\server\ETL-BizTalk\Automation\Approved\&amp;lt;/ns0:PermissionRequestApprovedPath&amp;gt;&lt;br /&gt;
  &amp;lt;ns0:PermissionRequestNotApprovedPath&amp;gt;\\server\ETL-BizTalk\Automation\NotApproved\&amp;lt;/ns0:PermissionRequestNotApprovedPath&amp;gt;&lt;br /&gt;
&amp;lt;/ns0:MsgSchedulerTriggerSQLJobReceive&amp;gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Every node of this schema was promoted to a distinguished field so that the values can be used for decision making in the orchestration.  The first decision made is on the "IsPermissionRequired" field.&lt;/p&gt;
&lt;p&gt;&lt;img height="256" width="640" src="/images/geekswithblogs_net/LifeLongTechie/10637/r_BizTalk-SQLJob-Permission_Linking_OrchestrationStart.JPG" alt="" /&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;If permission is required (IsPermissionRequired=="YES"), BizTalk will use the configuration info in the XML trigger to format the email message.  Here is the snippet of how the email message is constructed.&lt;/p&gt;
&lt;p&gt;SQLJobEmailMessage.EmailBody &lt;br /&gt;
    = new Eai.OrchestrationHelpers.XlangCustomFormatters.RawString(&lt;br /&gt;
        MsgSchedulerTriggerSQLJobReceive.EmailMessageBodyForPermissionRequest + &lt;br /&gt;
        "&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;" +&lt;br /&gt;
        "By moving the file, you are either giving permission to the process, or disapprove of the process." +&lt;br /&gt;
        "&amp;lt;br&amp;gt;" +&lt;br /&gt;
        "This is the file to move: \"" + PermissionTriggerToBeGenereatedHere +&lt;br /&gt;
        "\"&amp;lt;br&amp;gt;" +&lt;br /&gt;
        "(You may find it easier to open the destination folder first, then navigate to the sibling folder to get to this file)" +&lt;br /&gt;
        "&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;" +&lt;br /&gt;
        "To approve, move(NOT copy) the file here: " + MsgSchedulerTriggerSQLJobReceive.PermissionRequestApprovedPath +&lt;br /&gt;
        "&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;" + &lt;br /&gt;
        "To disapprove, move(NOT copy) the file here: " + MsgSchedulerTriggerSQLJobReceive.PermissionRequestNotApprovedPath +&lt;br /&gt;
        "&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;" + &lt;br /&gt;
        "The file will be IMMEDIATELY picked up by the automated process.  This is normal.  You should receive a message soon that the file is processed." +&lt;br /&gt;
        "&amp;lt;br&amp;gt;" + &lt;br /&gt;
        "Thank you!"&lt;br /&gt;
    );&lt;br /&gt;
SQLJobSendNotification(Microsoft.XLANGs.BaseTypes.Address) = "mailto:" + MsgSchedulerTriggerSQLJobReceive.EmailRecipientToList;&lt;br /&gt;
SQLJobEmailMessage.EmailBody(Microsoft.XLANGs.BaseTypes.ContentType) = "text/html";&lt;br /&gt;
SQLJobEmailMessage(SMTP.Subject) = "Requesting Permission to Start the " + MsgSchedulerTriggerSQLJobReceive.BusinessProcessName;&lt;br /&gt;
SQLJobEmailMessage(SMTP.From) = MsgSchedulerTriggerSQLJobReceive.EmailFrom;&lt;br /&gt;
SQLJobEmailMessage(SMTP.CC) = MsgSchedulerTriggerSQLJobReceive.EmailRecipientCCList;&lt;br /&gt;
SQLJobEmailMessage(SMTP.EmailBodyFileCharset) = "UTF-8";&lt;br /&gt;
SQLJobEmailMessage(SMTP.SMTPHost) = "localhost";&lt;br /&gt;
SQLJobEmailMessage(SMTP.MessagePartsAttachments) = 2;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;After the Permission request email is sent, the next step is to generate the actual Permission Trigger file.  A correlation set is used here on SQLJobName and a newly generated GUID field.&lt;/p&gt;
&lt;p&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&amp;lt;ns0:SQLJobAuthorizationTrigger xmlns:ns0="somethingsomething"&amp;gt;&amp;lt;SQLJobName&amp;gt;Data Push&amp;lt;/SQLJobName&amp;gt;&amp;lt;CorrelationGuid&amp;gt;9f7c6b46-0e62-46a7-b3a0-b5327ab03753&amp;lt;/CorrelationGuid&amp;gt;&amp;lt;/ns0:SQLJobAuthorizationTrigger&amp;gt;&lt;/p&gt;
&lt;p&gt;The end user (the human intervention piece) will either grant permission for this process, or deny it, by moving the Permission Trigger file to either the "Approved" folder or the "NotApproved" folder.  A parallel Listen shape is waiting for either response.&lt;/p&gt;
&lt;p&gt;&lt;img height="480" width="604" src="/images/geekswithblogs_net/LifeLongTechie/10637/r_BizTalk-SQLJob-Permission_Linking_EmailPermissionRequestAndApprovalProcess.JPG" alt="" /&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;The next set of steps decide how the SQL Job is to be called, or whether it is called at all.  If permission denied, it simply sends out a notification.  If permission is granted, then the flag (IsProcessAsync) in the original Process Trigger is used.  The synchonous part is not really synchronous, but a loop timer to check the status within the calling stored procedure (for more information, check out my previous post:  http://geekswithblogs.net/LifeLongTechie/archive/2010/11/01/execute-sql-job-synchronously-for-biztalk-via-a-stored-procedure.aspx)  If it's async, then the sp starts the job and BizTalk sends out an email.&lt;/p&gt;
&lt;p&gt;&lt;img height="480" width="581" src="/images/geekswithblogs_net/LifeLongTechie/10637/r_BizTalk-SQLJob-Permission_Linking_StartSQLJob.JPG" alt="" /&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;And of course, some error notification:&lt;/p&gt;
&lt;p&gt;&lt;img height="480" width="546" src="/images/geekswithblogs_net/LifeLongTechie/10637/r_BizTalk-SQLJob-Permission_Linking_ExceptionHandling.JPG" alt="" /&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Footnote: The next version of this orchestration will have an additional parallel line near the Listen shape with a Delay built in and a Loop to send out a daily reminder if no response has been received from the end user.  The synchronous part is used to gather results and execute a data clean up process so that the SQL Job can be re-tried.  There are manu possibilities here.&lt;/p&gt; &lt;img src="http://geekswithblogs.net/LifeLongTechie/aggbug/143807.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Kevin Shyr</dc:creator>
            <guid>http://geekswithblogs.net/LifeLongTechie/archive/2011/02/04/using-biztalk-to-bridge-sql-job-and-human-intervention-requesting.aspx</guid>
            <pubDate>Fri, 04 Feb 2011 21:29:09 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/LifeLongTechie/comments/143807.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/LifeLongTechie/archive/2011/02/04/using-biztalk-to-bridge-sql-job-and-human-intervention-requesting.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/LifeLongTechie/comments/commentRss/143807.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/LifeLongTechie/services/trackbacks/143807.aspx</trackback:ping>
        </item>
        <item>
            <title>Using SSIS to send a HTML E-Mail Message with built-in table of Counts.</title>
            <link>http://geekswithblogs.net/LifeLongTechie/archive/2011/02/02/using-ssis-to-send-a-html-e-mail-message-with-built-in.aspx</link>
            <description>&lt;p&gt;For the record, this can be just as easily done with a .NET class with a DLL call.  The two major reasons for this ending up as a SSIS package are:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;There are a lot of SQL resources in the organization for maintenance, but not as many .NET developers.&lt;/li&gt;
    &lt;li&gt;There is an existing automated process that links up SQL Jobs (more on that in the next post), and this is part of that process.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;To start, this is what the SSIS looks like:&lt;/p&gt;
&lt;p&gt;&lt;img alt="" width="250" height="480" src="/images/geekswithblogs_net/LifeLongTechie/10637/r_Using%20SSIS%20to%20send%20a%20HTML%20E-Mail%20Message%20with%20built-in%20table%20of%20Counts%20-%20SSIS%20screenshot.JPG" /&gt;&lt;/p&gt;
&lt;p&gt;The first part of the control flow is just for the override scenario.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;In the Execute SQL Task, it calls a stored procedure, which already formats the result into XML by using "&lt;span style="color: rgb(0,0,255)"&gt;FOR XML PATH&lt;/span&gt;(&lt;span style="color: rgb(255,0,0)"&gt;'Row'&lt;/span&gt;), &lt;span style="color: rgb(0,0,255)"&gt;ROOT&lt;/span&gt;(&lt;span style="color: rgb(255,0,0)"&gt;N'FieldingCounts'&lt;/span&gt;)".  The result XML string looks like this:&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(51,153,102)"&gt;&amp;lt;FieldingCounts&amp;gt;&lt;br /&gt;
  &amp;lt;Row&amp;gt;&lt;br /&gt;
    &amp;lt;CellId&amp;gt;M COD&amp;lt;/CellId&amp;gt;&lt;br /&gt;
    &amp;lt;Mailed&amp;gt;64&amp;lt;/Mailed&amp;gt;&lt;br /&gt;
    &amp;lt;ReMailed&amp;gt;210&amp;lt;/ReMailed&amp;gt;&lt;br /&gt;
    &amp;lt;TotalMail&amp;gt;274&amp;lt;/TotalMail&amp;gt;&lt;br /&gt;
    &amp;lt;EMailed&amp;gt;233&amp;lt;/EMailed&amp;gt;&lt;br /&gt;
    &amp;lt;TotalSent&amp;gt;297&amp;lt;/TotalSent&amp;gt;&lt;br /&gt;
  &amp;lt;/Row&amp;gt;&lt;br /&gt;
  &amp;lt;Row&amp;gt;&lt;br /&gt;
    &amp;lt;CellId&amp;gt;M National&amp;lt;/CellId&amp;gt;&lt;br /&gt;
    &amp;lt;Mailed&amp;gt;11&amp;lt;/Mailed&amp;gt;&lt;br /&gt;
    &amp;lt;ReMailed&amp;gt;59&amp;lt;/ReMailed&amp;gt;&lt;br /&gt;
    &amp;lt;TotalMail&amp;gt;70&amp;lt;/TotalMail&amp;gt;&lt;br /&gt;
    &amp;lt;EMailed&amp;gt;90&amp;lt;/EMailed&amp;gt;&lt;br /&gt;
    &amp;lt;TotalSent&amp;gt;101&amp;lt;/TotalSent&amp;gt;&lt;br /&gt;
  &amp;lt;/Row&amp;gt;&lt;br /&gt;
  &amp;lt;Row&amp;gt;&lt;br /&gt;
    &amp;lt;CellId&amp;gt;U COD&amp;lt;/CellId&amp;gt;&lt;br /&gt;
    &amp;lt;Mailed&amp;gt;91&amp;lt;/Mailed&amp;gt;&lt;br /&gt;
    &amp;lt;ReMailed&amp;gt;238&amp;lt;/ReMailed&amp;gt;&lt;br /&gt;
    &amp;lt;TotalMail&amp;gt;329&amp;lt;/TotalMail&amp;gt;&lt;br /&gt;
    &amp;lt;EMailed&amp;gt;291&amp;lt;/EMailed&amp;gt;&lt;br /&gt;
    &amp;lt;TotalSent&amp;gt;382&amp;lt;/TotalSent&amp;gt;&lt;br /&gt;
  &amp;lt;/Row&amp;gt;&lt;br /&gt;
  &amp;lt;Row&amp;gt;&lt;br /&gt;
    &amp;lt;CellId&amp;gt;U National&amp;lt;/CellId&amp;gt;&lt;br /&gt;
    &amp;lt;Mailed&amp;gt;63&amp;lt;/Mailed&amp;gt;&lt;br /&gt;
    &amp;lt;ReMailed&amp;gt;286&amp;lt;/ReMailed&amp;gt;&lt;br /&gt;
    &amp;lt;TotalMail&amp;gt;349&amp;lt;/TotalMail&amp;gt;&lt;br /&gt;
    &amp;lt;EMailed&amp;gt;374&amp;lt;/EMailed&amp;gt;&lt;br /&gt;
    &amp;lt;TotalSent&amp;gt;437&amp;lt;/TotalSent&amp;gt;&lt;br /&gt;
  &amp;lt;/Row&amp;gt;&lt;br /&gt;
&amp;lt;/FieldingCounts&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt; This result is saved into an internal SSIS variable with the following settings on the General tab and the Result Set tab:&lt;/p&gt;
&lt;p&gt;&lt;img alt="" width="502" height="480" src="/images/geekswithblogs_net/LifeLongTechie/10637/r_Using%20SSIS%20to%20send%20a%20HTML%20E-Mail%20Message%20with%20built-in%20table%20of%20Counts%20-%20ExecSQLTask_General.JPG" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="" width="513" height="480" src="/images/geekswithblogs_net/LifeLongTechie/10637/r_Using%20SSIS%20to%20send%20a%20HTML%20E-Mail%20Message%20with%20built-in%20table%20of%20Counts%20-%20ExecSQLTask_Result%20Set.JPG" /&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Now comes the trickier part.  We need to use the XML Task to format the XML string result into an HTML table, and I used Direct input XSLT&lt;/p&gt;
&lt;p&gt;&lt;img alt="" width="502" height="480" src="/images/geekswithblogs_net/LifeLongTechie/10637/r_Using%20SSIS%20to%20send%20a%20HTML%20E-Mail%20Message%20with%20built-in%20table%20of%20Counts%20-%20XMLTask_GeneralJPG.JPG" /&gt;&lt;/p&gt;
&lt;p&gt;And here is the code of XSLT:&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&amp;gt;&lt;br /&gt;
&amp;lt;xsl:output method="html" indent="yes"/&amp;gt;&lt;br /&gt;
  &amp;lt;xsl:template match="/ROOT"&amp;gt;&lt;br /&gt;
        &amp;lt;table border="1" cellpadding="6"&amp;gt;&lt;br /&gt;
          &amp;lt;tr&amp;gt;&lt;br /&gt;
            &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
            &amp;lt;td&amp;gt;Mailed&amp;lt;/td&amp;gt;&lt;br /&gt;
            &amp;lt;td&amp;gt;Re-mailed&amp;lt;/td&amp;gt;&lt;br /&gt;
            &amp;lt;td&amp;gt;Total Mail (Mailed, Re-mailed)&amp;lt;/td&amp;gt;&lt;br /&gt;
            &amp;lt;td&amp;gt;E-mailed&amp;lt;/td&amp;gt;&lt;br /&gt;
            &amp;lt;td&amp;gt;Total Sent (Mailed, E-mailed)&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;/tr&amp;gt;&lt;br /&gt;
          &amp;lt;xsl:for-each select="FieldingCounts/Row"&amp;gt;&lt;br /&gt;
            &amp;lt;tr&amp;gt;&lt;br /&gt;
              &amp;lt;xsl:for-each select="./*"&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&lt;br /&gt;
                  &amp;lt;xsl:value-of select="." /&amp;gt;&lt;br /&gt;
                &amp;lt;/td&amp;gt;&lt;br /&gt;
              &amp;lt;/xsl:for-each&amp;gt;&lt;br /&gt;
            &amp;lt;/tr&amp;gt;&lt;br /&gt;
          &amp;lt;/xsl:for-each&amp;gt;&lt;br /&gt;
        &amp;lt;/table&amp;gt;&lt;br /&gt;
  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;
&amp;lt;/xsl:stylesheet&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; Then a script task is used to send out an HTML email (as we are all painfully aware that SSIS Send Mail Task only sends plain text)&lt;br /&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
&lt;w:WordDocument&gt;
&lt;w:View&gt;Normal&lt;/w:View&gt;
&lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
&lt;w:TrackMoves /&gt;
&lt;w:TrackFormatting /&gt;
&lt;w:PunctuationKerning /&gt;
&lt;w:ValidateAgainstSchemas /&gt;
&lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
&lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
&lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
&lt;w:DoNotPromoteQF /&gt;
&lt;w:LidThemeOther&gt;EN-US&lt;/w:LidThemeOther&gt;
&lt;w:LidThemeAsian&gt;X-NONE&lt;/w:LidThemeAsian&gt;
&lt;w:LidThemeComplexScript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;
&lt;w:Compatibility&gt;
&lt;w:BreakWrappedTables /&gt;
&lt;w:SnapToGridInCell /&gt;
&lt;w:WrapTextWithPunct /&gt;
&lt;w:UseAsianBreakRules /&gt;
&lt;w:DontGrowAutofit /&gt;
&lt;w:SplitPgBreakAndParaMark /&gt;
&lt;w:DontVertAlignCellWithSp /&gt;
&lt;w:DontBreakConstrainedForcedTables /&gt;
&lt;w:DontVertAlignInTxbx /&gt;
&lt;w:Word11KerningPairs /&gt;
&lt;w:CachedColBalance /&gt;
&lt;/w:Compatibility&gt;
&lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
&lt;m:mathPr&gt;
&lt;m:mathFont m:val="Cambria Math" /&gt;
&lt;m:brkBin m:val="before" /&gt;
&lt;m:brkBinSub m:val="&amp;#45;-" /&gt;
&lt;m:smallFrac m:val="off" /&gt;
&lt;m:dispDef /&gt;
&lt;m:lMargin m:val="0" /&gt;
&lt;m:rMargin m:val="0" /&gt;
&lt;m:defJc m:val="centerGroup" /&gt;
&lt;m:wrapIndent m:val="1440" /&gt;
&lt;m:intLim m:val="subSup" /&gt;
&lt;m:naryLim m:val="undOvr" /&gt;
&lt;/m:mathPr&gt;&lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
&lt;w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267"&gt;
&lt;w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal" /&gt;
&lt;w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1" /&gt;
&lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2" /&gt;
&lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3" /&gt;
&lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4" /&gt;
&lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5" /&gt;
&lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6" /&gt;
&lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7" /&gt;
&lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8" /&gt;
&lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9" /&gt;
&lt;w:LsdException Locked="false" Priority="39" Name="toc 1" /&gt;
&lt;w:LsdException Locked="false" Priority="39" Name="toc 2" /&gt;
&lt;w:LsdException Locked="false" Priority="39" Name="toc 3" /&gt;
&lt;w:LsdException Locked="false" Priority="39" Name="toc 4" /&gt;
&lt;w:LsdException Locked="false" Priority="39" Name="toc 5" /&gt;
&lt;w:LsdException Locked="false" Priority="39" Name="toc 6" /&gt;
&lt;w:LsdException Locked="false" Priority="39" Name="toc 7" /&gt;
&lt;w:LsdException Locked="false" Priority="39" Name="toc 8" /&gt;
&lt;w:LsdException Locked="false" Priority="39" Name="toc 9" /&gt;
&lt;w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption" /&gt;
&lt;w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title" /&gt;
&lt;w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font" /&gt;
&lt;w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle" /&gt;
&lt;w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong" /&gt;
&lt;w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis" /&gt;
&lt;w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid" /&gt;
&lt;w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text" /&gt;
&lt;w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing" /&gt;
&lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading" /&gt;
&lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List" /&gt;
&lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid" /&gt;
&lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1" /&gt;
&lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2" /&gt;
&lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1" /&gt;
&lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2" /&gt;
&lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1" /&gt;
&lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2" /&gt;
&lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3" /&gt;
&lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List" /&gt;
&lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading" /&gt;
&lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List" /&gt;
&lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid" /&gt;
&lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1" /&gt;
&lt;w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision" /&gt;
&lt;w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph" /&gt;
&lt;w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote" /&gt;
&lt;w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote" /&gt;
&lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1" /&gt;
&lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2" /&gt;
&lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3" /&gt;
&lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4" /&gt;
&lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5" /&gt;
&lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6" /&gt;
&lt;w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis" /&gt;
&lt;w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis" /&gt;
&lt;w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference" /&gt;
&lt;w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference" /&gt;
&lt;w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title" /&gt;
&lt;w:LsdException Locked="false" Priority="37" Name="Bibliography" /&gt;
&lt;w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading" /&gt;
&lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;/p&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt;&lt;span style="font-size: 10pt"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt"&gt; System;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt;&lt;span style="font-size: 10pt"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt"&gt; System.Data;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt;&lt;span style="font-size: 10pt"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt"&gt; Microsoft.SqlServer.Dts.Runtime;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt;&lt;span style="font-size: 10pt"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt"&gt; System.Windows.Forms;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt;&lt;span style="font-size: 10pt"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt"&gt; System.Net.Mail;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt;&lt;span style="font-size: 10pt"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt"&gt; System.Net;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt; &lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt;&lt;span style="font-size: 10pt"&gt;namespace&lt;/span&gt;&lt;span style="font-size: 10pt"&gt; ST_b829a2615e714bcfb55db0ce97be3901.csproj&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt;&lt;span style="font-size: 10pt"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt;&lt;span style="font-size: 10pt"&gt;    [System.AddIn.&lt;span style="color: rgb(43,145,175)"&gt;AddIn&lt;/span&gt;(&lt;span style="color: rgb(163,21,21)"&gt;"ScriptMain"&lt;/span&gt;, Version = &lt;span style="color: rgb(163,21,21)"&gt;"1.0"&lt;/span&gt;, Publisher = &lt;span style="color: rgb(163,21,21)"&gt;""&lt;/span&gt;, Description = &lt;span style="color: rgb(163,21,21)"&gt;""&lt;/span&gt;)]&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;partial&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;ScriptMain&lt;/span&gt; : Microsoft.SqlServer.Dts.Tasks.ScriptTask.&lt;span style="color: rgb(43,145,175)"&gt;VSTARTScriptObjectModelBase&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt;&lt;span style="font-size: 10pt"&gt;    {&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt; &lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt;&lt;span style="font-size: 10pt"&gt;        #region&lt;/span&gt;&lt;span style="font-size: 10pt"&gt; VSTA generated code&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;enum&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;ScriptResults&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt;&lt;span style="font-size: 10pt"&gt;        {&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt;&lt;span style="font-size: 10pt"&gt;            Success = Microsoft.SqlServer.Dts.Runtime.&lt;span style="color: rgb(43,145,175)"&gt;DTSExecResult&lt;/span&gt;.Success,&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt;&lt;span style="font-size: 10pt"&gt;            Failure = Microsoft.SqlServer.Dts.Runtime.&lt;span style="color: rgb(43,145,175)"&gt;DTSExecResult&lt;/span&gt;.Failure&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt;&lt;span style="font-size: 10pt"&gt;        };&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt;&lt;span style="font-size: 10pt"&gt;        #endregion&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt; &lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; Main()&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt;&lt;span style="font-size: 10pt"&gt;        {&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: rgb(43,145,175)"&gt;String&lt;/span&gt; EmailMsgBody = &lt;span style="color: rgb(43,145,175)"&gt;String&lt;/span&gt;.Format(&lt;span style="color: rgb(163,21,21)"&gt;"&amp;lt;HTML&amp;gt;&amp;lt;BODY&amp;gt;&amp;lt;P&amp;gt;{0}&amp;lt;/P&amp;gt;&amp;lt;P&amp;gt;{1}&amp;lt;/P&amp;gt;&amp;lt;/BODY&amp;gt;&amp;lt;/HTML&amp;gt;"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt;&lt;span style="font-size: 10pt"&gt;                                                , Dts.Variables[&lt;span style="color: rgb(163,21,21)"&gt;"Config_SMTP_MessageSourceText"&lt;/span&gt;].Value.ToString()&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt;&lt;span style="font-size: 10pt"&gt;                                                , Dts.Variables[&lt;span style="color: rgb(163,21,21)"&gt;"InternalStr_CountResultAfterXSLT"&lt;/span&gt;].Value.ToString());&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: rgb(43,145,175)"&gt;MailMessage&lt;/span&gt; EmailCountMsg = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;MailMessage&lt;/span&gt;(Dts.Variables[&lt;span style="color: rgb(163,21,21)"&gt;"Config_SMTP_From"&lt;/span&gt;].Value.ToString().Replace(&lt;span style="color: rgb(163,21,21)"&gt;";"&lt;/span&gt;, &lt;span style="color: rgb(163,21,21)"&gt;","&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt;&lt;span style="font-size: 10pt"&gt;                                                        , Dts.Variables[&lt;span style="color: rgb(163,21,21)"&gt;"Config_SMTP_Success_To"&lt;/span&gt;].Value.ToString().Replace(&lt;span style="color: rgb(163,21,21)"&gt;";"&lt;/span&gt;, &lt;span style="color: rgb(163,21,21)"&gt;","&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt;&lt;span style="font-size: 10pt"&gt;                                                        , Dts.Variables[&lt;span style="color: rgb(163,21,21)"&gt;"Config_SMTP_SubjectLinePrefix"&lt;/span&gt;].Value.ToString() + &lt;span style="color: rgb(163,21,21)"&gt;" "&lt;/span&gt; + Dts.Variables[&lt;span style="color: rgb(163,21,21)"&gt;"InternalStr_FieldingDate"&lt;/span&gt;].Value.ToString()&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt;&lt;span style="font-size: 10pt"&gt;                                                        , EmailMsgBody);&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: green"&gt;//EmailCountMsg.From.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt;&lt;span style="font-size: 10pt"&gt;            EmailCountMsg.CC.Add(Dts.Variables[&lt;span style="color: rgb(163,21,21)"&gt;"Config_SMTP_Success_CC"&lt;/span&gt;].Value.ToString().Replace(&lt;span style="color: rgb(163,21,21)"&gt;";"&lt;/span&gt;, &lt;span style="color: rgb(163,21,21)"&gt;","&lt;/span&gt;));&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt;&lt;span style="font-size: 10pt"&gt;            EmailCountMsg.IsBodyHtml = &lt;span style="color: blue"&gt;true&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt; &lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: rgb(43,145,175)"&gt;SmtpClient&lt;/span&gt; SMTPForCount = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;SmtpClient&lt;/span&gt;(Dts.Variables[&lt;span style="color: rgb(163,21,21)"&gt;"Config_SMTP_ServerAddress"&lt;/span&gt;].Value.ToString());&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt;&lt;span style="font-size: 10pt"&gt;            SMTPForCount.Credentials = &lt;span style="color: rgb(43,145,175)"&gt;CredentialCache&lt;/span&gt;.DefaultNetworkCredentials;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt; &lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt;&lt;span style="font-size: 10pt"&gt;            SMTPForCount.Send(EmailCountMsg);&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt; &lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt;&lt;span style="font-size: 10pt"&gt;            Dts.TaskResult = (&lt;span style="color: blue"&gt;int&lt;/span&gt;)&lt;span style="color: rgb(43,145,175)"&gt;ScriptResults&lt;/span&gt;.Success;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt;&lt;span style="font-size: 10pt"&gt;        }&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal; margin-bottom: 0pt"&gt;&lt;span style="font-size: 10pt"&gt;    }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="line-height: 115%; font-size: 10pt"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;Note on this code: notice the email list has Replace(";", ",").  This is only here because the list is configurable in the SQL Job Step at Set Values, which does not react well with colons as email separator, but system.Net.Mail only handles comma as email separator, hence the extra replace in the string.&lt;/p&gt;
&lt;p&gt;The result is a nicely formatted email message with count information:&lt;/p&gt;
&lt;p&gt;&lt;img alt="" width="640" height="372" src="/images/geekswithblogs_net/LifeLongTechie/10637/r_Using%20SSIS%20to%20send%20a%20HTML%20E-Mail%20Message%20with%20built-in%20table%20of%20Counts%20-%20Result%20Email.JPG" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="file:///C:/DOCUME~1/shyrkh/LOCALS~1/Temp/moz-screenshot.png" /&gt;&lt;/p&gt; &lt;img src="http://geekswithblogs.net/LifeLongTechie/aggbug/143770.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Kevin Shyr</dc:creator>
            <guid>http://geekswithblogs.net/LifeLongTechie/archive/2011/02/02/using-ssis-to-send-a-html-e-mail-message-with-built-in.aspx</guid>
            <pubDate>Wed, 02 Feb 2011 21:47:05 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/LifeLongTechie/comments/143770.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/LifeLongTechie/archive/2011/02/02/using-ssis-to-send-a-html-e-mail-message-with-built-in.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/LifeLongTechie/comments/commentRss/143770.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/LifeLongTechie/services/trackbacks/143770.aspx</trackback:ping>
        </item>
        <item>
            <title>What is the advantage of WCF</title>
            <link>http://geekswithblogs.net/LifeLongTechie/archive/2010/02/19/what-is-the-advantage-of-wcf.aspx</link>
            <description>&lt;p&gt;I knew the basic idea of WCF and how to build one, but could never win an argument on why it is better than a web service.&lt;/p&gt;
&lt;p&gt;Thanks for Christopher Roberts of Oakwood Systems Group Inc. sending me this link.  I can answer that question much better now.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/dd943056.aspx"&gt;http://msdn.microsoft.com/en-us/library/dd943056.aspx&lt;/a&gt;&lt;/p&gt; &lt;img src="http://geekswithblogs.net/LifeLongTechie/aggbug/138049.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Kevin Shyr</dc:creator>
            <guid>http://geekswithblogs.net/LifeLongTechie/archive/2010/02/19/what-is-the-advantage-of-wcf.aspx</guid>
            <pubDate>Fri, 19 Feb 2010 20:07:12 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/LifeLongTechie/comments/138049.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/LifeLongTechie/archive/2010/02/19/what-is-the-advantage-of-wcf.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/LifeLongTechie/comments/commentRss/138049.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/LifeLongTechie/services/trackbacks/138049.aspx</trackback:ping>
        </item>
        <item>
            <title>Convert GridViewRows into a DataTable to edit data in ASP .NET</title>
            <link>http://geekswithblogs.net/LifeLongTechie/archive/2010/02/19/convert-gridviewrows-into-a-datatable-in-asp-.net.aspx</link>
            <description>&lt;p&gt;I recently ran into a business problem that I can't find any sample code online.  I think I worked out a tolerable solution.&lt;/p&gt;
&lt;p&gt;The business scenario is this:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;All rows retrieve from the database must be in edit mode, but only some fields should be in edit mode, not all.  Editing one row at a time is out of the question.&lt;/li&gt;
    &lt;li&gt;User might make changes and THEN want to sort the grid.  Any user input needs to be preserved.&lt;/li&gt;
    &lt;li&gt;Have to use .NET control that come out of the box with Visual Studio due to maintenance concerns.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The solution i came up with basically get the GridViewRows on postback and put everything into a datatable, then I am free to do whatever I want with it.  Also, there is no hard-coded control ID or column name or cell index, which makes it more reuseable.&lt;/p&gt;
&lt;p&gt;Solution limitation:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Only 2 type of edit controls are considered: TextBox and DropDownList.  Their ID have to be "txt/ddl" + database column name&lt;/li&gt;
    &lt;li&gt;Any additional field has to come before the first column or after the last column &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Code (in VB.NET)&lt;/p&gt;
&lt;p&gt;GridView:&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;asp&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;GridView&lt;/span&gt; &lt;span style="color: red;"&gt;ID&lt;/span&gt;&lt;span style="color: blue;"&gt;="grdClaims"&lt;/span&gt; &lt;span style="color: red;"&gt;runat&lt;/span&gt;&lt;span style="color: blue;"&gt;="server"&lt;/span&gt; &lt;span style="color: red;"&gt;style&lt;/span&gt;&lt;span style="color: blue;"&gt;="position: absolute;&lt;span style=""&gt;  &lt;/span&gt;top: 224px; left:10px;"&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style="color: red;"&gt;AutoGenerateColumns&lt;/span&gt;&lt;span style="color: blue;"&gt;="False"&lt;/span&gt; &lt;span style="color: red;"&gt;AllowPaging&lt;/span&gt;&lt;span style="color: blue;"&gt;="False"&lt;/span&gt; &lt;span style="color: red;"&gt;EnableViewState&lt;/span&gt;&lt;span style="color: blue;"&gt;="True"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style="color: red;"&gt;AllowSorting&lt;/span&gt;&lt;span style="color: blue;"&gt;="True"&lt;/span&gt; &lt;span style="color: red;"&gt;EmptyDataText&lt;/span&gt;&lt;span style="color: blue;"&gt;="No claims found."&lt;/span&gt; &lt;span style="color: red;"&gt;EnableTheming&lt;/span&gt;&lt;span style="color: blue;"&gt;="False"&lt;/span&gt; &lt;span style="color: blue;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;RowStyle&lt;/span&gt; &lt;span style="color: red;"&gt;CssClass&lt;/span&gt;&lt;span style="color: blue;"&gt;="gridcell"&lt;/span&gt; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Columns&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;asp&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;TemplateField&lt;/span&gt; &lt;span style="color: red;"&gt;HeaderText&lt;/span&gt;&lt;span style="color: blue;"&gt;="Select"&lt;/span&gt; &lt;span style="color: red;"&gt;ItemStyle-CssClass&lt;/span&gt;&lt;span style="color: blue;"&gt;="gridtext"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;                &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;HeaderTemplate&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;                    &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;asp&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;CheckBox&lt;/span&gt; &lt;span style="color: red;"&gt;ID&lt;/span&gt;&lt;span style="color: blue;"&gt;="chkSelectAll"&lt;/span&gt; &lt;span style="color: red;"&gt;runat&lt;/span&gt;&lt;span style="color: blue;"&gt;="server"&lt;/span&gt; &lt;span style="color: red;"&gt;onclick&lt;/span&gt;&lt;span style="color: blue;"&gt;="fnSelectAll(this.checked)"&lt;/span&gt; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;                &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;HeaderTemplate&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;                &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;ItemTemplate&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;                    &lt;/span&gt;&lt;span style="color: red;"&gt;&amp;amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;asp&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;CheckBox&lt;/span&gt; &lt;span style="color: red;"&gt;ID&lt;/span&gt;&lt;span style="color: blue;"&gt;="chkSelect"&lt;/span&gt; &lt;span style="color: red;"&gt;runat&lt;/span&gt;&lt;span style="color: blue;"&gt;="server"&lt;/span&gt; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;                &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;ItemTemplate&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;                &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;ItemStyle&lt;/span&gt; &lt;span style="color: red;"&gt;CssClass&lt;/span&gt;&lt;span style="color: blue;"&gt;="gridtext"&lt;/span&gt; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;asp&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;TemplateField&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;asp&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;BoundField&lt;/span&gt; &lt;span style="color: red;"&gt;DataField&lt;/span&gt;&lt;span style="color: blue;"&gt;="CLAIMNR"&lt;/span&gt; &lt;span style="color: red;"&gt;HeaderText&lt;/span&gt;&lt;span style="color: blue;"&gt;="Claim#"&lt;/span&gt; &lt;span style="color: red;"&gt;SortExpression&lt;/span&gt;&lt;span style="color: blue;"&gt;="CLAIMNR"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;                &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;HeaderStyle&lt;/span&gt; &lt;span style="color: red;"&gt;Wrap&lt;/span&gt;&lt;span style="color: blue;"&gt;="false"&lt;/span&gt; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;                &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;ItemStyle&lt;/span&gt; &lt;span style="color: red;"&gt;Wrap&lt;/span&gt;&lt;span style="color: blue;"&gt;="true"&lt;/span&gt; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;asp&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;BoundField&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt; A Drop Down List in the GridView&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;asp&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;TemplateField&lt;/span&gt; &lt;span style="color: red;"&gt;HeaderText&lt;/span&gt;&lt;span style="color: blue;"&gt;="Delete"&lt;/span&gt; &lt;span style="color: red;"&gt;SortExpression&lt;/span&gt;&lt;span style="color: blue;"&gt;="DELETECLMFLAG"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;                &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;ItemTemplate&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;                    &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;asp&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;DropDownList&lt;/span&gt; &lt;span style="color: red;"&gt;ID&lt;/span&gt;&lt;span style="color: blue;"&gt;="ddlDELETECLMFLAG"&lt;/span&gt; &lt;span style="color: red;"&gt;runat&lt;/span&gt;&lt;span style="color: blue;"&gt;="server"&lt;/span&gt; &lt;span style="color: red;"&gt;Text&lt;/span&gt;&lt;span style="color: blue;"&gt;='&lt;/span&gt;&lt;span style="background: none repeat scroll 0% 0% yellow;"&gt;&amp;lt;%&lt;/span&gt;#DataBinder.Eval(Container.DataItem, "DELETECLMFLAG").ToString().Trim()&lt;span style="background: none repeat scroll 0% 0% yellow;"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue;"&gt; '&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;                        &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;asp&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;ListItem&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;Y&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;asp&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;ListItem&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;                        &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;asp&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;ListItem&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;N&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;asp&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;ListItem&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;                    &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;asp&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;DropDownList&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;                &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;ItemTemplate&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;asp&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;TemplateField&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Code behind:&lt;/p&gt;
&lt;p&gt;[Updated on 2/22/2010 to fix a bug and for the code to be more efficient]&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt 80px;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: blue; font-size: 10pt;"&gt;Dim&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;font color="#000000"&gt; dtClaims &lt;/font&gt;&lt;span style="color: blue;"&gt;As&lt;/span&gt;&lt;font color="#000000"&gt; System.Data.DataTable&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;&lt;font color="#000000"&gt;        &lt;/font&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;Dim&lt;/span&gt;&lt;font color="#000000"&gt; iColOffSet &lt;/font&gt;&lt;span style="color: blue;"&gt;As&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: blue;"&gt;Integer&lt;/span&gt;&lt;font color="#000000"&gt; = 2 &lt;/font&gt;&lt;span style="color: green;"&gt;'This is because the display grid has 2 extra cells at the beginning&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: green; font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;font color="#000000"&gt;&lt;span style=""&gt;        &lt;/span&gt;dtClaims = dtInsertClaimDetails.Clone() &lt;/font&gt;&lt;span style="color: green;"&gt;'dtModifyClaimDetails was cloned the first time the dataset was populated&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: green; font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;&lt;font color="#000000"&gt;        &lt;/font&gt;&lt;/span&gt;&lt;span style="color: green;"&gt;' Limitation for GridView:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;&lt;font color="#000000"&gt;        &lt;/font&gt;&lt;/span&gt;&lt;span style="color: green;"&gt;'&lt;span style=""&gt;  &lt;/span&gt;Data not from the datasource must be at the beginning or the end of the layout, and iColOffSet has to be set&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;&lt;font color="#000000"&gt;        &lt;/font&gt;&lt;/span&gt;&lt;span style="color: green;"&gt;'&lt;span style=""&gt;  &lt;/span&gt;The code currently assumes that only TextBox or Drop Down List will be used and their ID must be "txt" + ColumnName for&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;&lt;font color="#000000"&gt;        &lt;/font&gt;&lt;/span&gt;&lt;span style="color: green;"&gt;'&lt;span style=""&gt;      &lt;/span&gt;TextBox or "ddl" + ColumnName for Drop Down List&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;&lt;font color="#000000"&gt;        &lt;/font&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;For&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: blue;"&gt;Each&lt;/span&gt;&lt;font color="#000000"&gt; drGridView &lt;/font&gt;&lt;span style="color: blue;"&gt;As&lt;/span&gt;&lt;font color="#000000"&gt; GridViewRow &lt;/font&gt;&lt;span style="color: blue;"&gt;In&lt;/span&gt;&lt;font color="#000000"&gt; gvInsertClaimDetails.Rows&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;&lt;font color="#000000"&gt;            &lt;/font&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;Dim&lt;/span&gt;&lt;font color="#000000"&gt; dr &lt;/font&gt;&lt;span style="color: blue;"&gt;As&lt;/span&gt;&lt;font color="#000000"&gt; System.Data.DataRow = dtClaims.NewRow()&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;&lt;font color="#000000"&gt;            &lt;/font&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;For&lt;/span&gt;&lt;font color="#000000"&gt; i &lt;/font&gt;&lt;span style="color: blue;"&gt;As&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: blue;"&gt;Integer&lt;/span&gt;&lt;font color="#000000"&gt; = iColOffSet &lt;/font&gt;&lt;span style="color: blue;"&gt;To&lt;/span&gt;&lt;font color="#000000"&gt; dr.ItemArray.Count + iColOffSet - 1&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;&lt;font color="#000000"&gt;                &lt;/font&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;Dim&lt;/span&gt;&lt;font color="#000000"&gt; sColumnName &lt;/font&gt;&lt;span style="color: blue;"&gt;As&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: blue;"&gt;String&lt;/span&gt;&lt;font color="#000000"&gt; = dtClaims.Columns(i - iColOffSet).ColumnName.ToString()&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;&lt;font color="#000000"&gt;                &lt;/font&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;Dim&lt;/span&gt;&lt;font color="#000000"&gt; sInputOrData &lt;/font&gt;&lt;span style="color: blue;"&gt;As&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: blue;"&gt;String&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: blue; font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;&lt;font color="#000000"&gt;                &lt;/font&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;If&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: blue;"&gt;Not&lt;/span&gt;&lt;font color="#000000"&gt; drGridView.Cells(iColOffSet).FindControl(&lt;/font&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;"txt"&lt;/span&gt;&lt;font color="#000000"&gt; + sColumnName) &lt;/font&gt;&lt;span style="color: blue;"&gt;Is&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: blue;"&gt;Nothing&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: blue;"&gt;Then&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;&lt;font color="#000000"&gt;                    &lt;/font&gt;&lt;/span&gt;&lt;span style="color: green;"&gt;'Found the textbox&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;font color="#000000"&gt;&lt;span style=""&gt;                    &lt;/span&gt;sInputOrData = &lt;/font&gt;&lt;span style="color: blue;"&gt;CType&lt;/span&gt;&lt;font color="#000000"&gt;(drGridView.Cells(iColOffSet).FindControl(&lt;/font&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;"txt"&lt;/span&gt;&lt;font color="#000000"&gt; + sColumnName), TextBox).Text&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;&lt;font color="#000000"&gt;                &lt;/font&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;ElseIf&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: blue;"&gt;Not&lt;/span&gt;&lt;font color="#000000"&gt; drGridView.Cells(iColOffSet).FindControl(&lt;/font&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;"ddl"&lt;/span&gt;&lt;font color="#000000"&gt; + sColumnName) &lt;/font&gt;&lt;span style="color: blue;"&gt;Is&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: blue;"&gt;Nothing&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: blue;"&gt;Then&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;&lt;font color="#000000"&gt;                    &lt;/font&gt;&lt;/span&gt;&lt;span style="color: green;"&gt;'Found the drop down list&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;font color="#000000"&gt;&lt;span style=""&gt;                    &lt;/span&gt;sInputOrData = &lt;/font&gt;&lt;span style="color: blue;"&gt;CType&lt;/span&gt;&lt;font color="#000000"&gt;(drGridView.Cells(iColOffSet).FindControl(&lt;/font&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;"ddl"&lt;/span&gt;&lt;font color="#000000"&gt; + sColumnName), DropDownList).SelectedValue&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;&lt;font color="#000000"&gt;                &lt;/font&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;Else&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;font color="#000000"&gt;&lt;span style=""&gt;                    &lt;/span&gt;sInputOrData = drGridView.Cells(i).Text&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;&lt;font color="#000000"&gt;                &lt;/font&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;End&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: blue;"&gt;If&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: blue; font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;&lt;font color="#000000"&gt;                &lt;/font&gt;&lt;/span&gt;&lt;span style="color: green;"&gt;' If the data is empty, do not insert back into datatable if the type is numbers, leave them NULL&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;&lt;font color="#000000"&gt;                &lt;/font&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;If&lt;/span&gt;&lt;font color="#000000"&gt; (dtClaims.Columns(i - iColOffSet).DataType.ToString() = &lt;/font&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;"System.Int32"&lt;/span&gt;&lt;font color="#000000"&gt; _&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;&lt;font color="#000000"&gt;                    &lt;/font&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;Or&lt;/span&gt;&lt;font color="#000000"&gt; dtClaims.Columns(i - iColOffSet).DataType.ToString() = &lt;/font&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;"System.Double"&lt;/span&gt;&lt;font color="#000000"&gt;) _&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;&lt;font color="#000000"&gt;                    &lt;/font&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;And&lt;/span&gt;&lt;font color="#000000"&gt; (&lt;/font&gt;&lt;span style="color: blue;"&gt;String&lt;/span&gt;&lt;font color="#000000"&gt;.IsNullOrEmpty(sInputOrData) &lt;/font&gt;&lt;span style="color: blue;"&gt;Or&lt;/span&gt;&lt;font color="#000000"&gt; sInputOrData = &lt;/font&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;"&amp;amp;nbsp;"&lt;/span&gt;&lt;font color="#000000"&gt;) &lt;/font&gt;&lt;span style="color: blue;"&gt;Then&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: blue; font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;&lt;font color="#000000"&gt;                    &lt;/font&gt;&lt;/span&gt;&lt;span style="color: green;"&gt;' Do nothing&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;&lt;font color="#000000"&gt;                &lt;/font&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;Else&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;&lt;font color="#000000"&gt;                    &lt;/font&gt;&lt;/span&gt;&lt;span style="color: green;"&gt;' Set the column&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;font color="#000000"&gt;&lt;span style=""&gt;                    &lt;/span&gt;dr.Item(i - iColOffSet) = System.Convert.ChangeType(sInputOrData, dtClaims.Columns(i - iColOffSet).DataType)&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;&lt;font color="#000000"&gt;                &lt;/font&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;End&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: blue;"&gt;If&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;&lt;font color="#000000"&gt;            &lt;/font&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;Next&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: blue; font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;font color="#000000"&gt;&lt;span style=""&gt;            &lt;/span&gt;dtClaims.Rows.Add(dr)&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;&lt;font color="#000000"&gt;        &lt;/font&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;Next&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span style=""&gt;&lt;font color="#000000"&gt;        &lt;/font&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;Return&lt;/span&gt;&lt;font color="#000000"&gt; dtClaims&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt; &lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt; &lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;[2010-04-16] Update:&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;The performance of this is good for a form with 30 columns (20 editable fields) for about 20 rows (a couple of seconds), but pretty bad for the same form with about 300 rows (1 minute).  This form was built with a couple of drop down list filters at the top of the page to filter result, so the general purpose is served.  This benchmark was done on P4 single core server with 3 GB RAM with default performance setting for the web server (and SQL on the same server).&lt;/p&gt; &lt;img src="http://geekswithblogs.net/LifeLongTechie/aggbug/138048.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Kevin Shyr</dc:creator>
            <guid>http://geekswithblogs.net/LifeLongTechie/archive/2010/02/19/convert-gridviewrows-into-a-datatable-in-asp-.net.aspx</guid>
            <pubDate>Fri, 19 Feb 2010 19:31:55 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/LifeLongTechie/comments/138048.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/LifeLongTechie/archive/2010/02/19/convert-gridviewrows-into-a-datatable-in-asp-.net.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/LifeLongTechie/comments/commentRss/138048.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/LifeLongTechie/services/trackbacks/138048.aspx</trackback:ping>
        </item>
    </channel>
</rss>
