<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Asmita's blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/asmitaw/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/asmitaw/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 03:19:05 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Replication using custom mapping AND custom table create scripts for NON SQL subscriber - Applies to SQL server 2005 and 2008</title>
      <link>https://docs.microsoft.com/archive/blogs/asmitaw/replication-using-custom-mapping-and-custom-table-create-scripts-for-non-sql-subscriber-applies-to-sql-server-2005-and-2008</link>
      <pubDate>Wed, 05 Aug 2009 12:38:35 GMT</pubDate>
      <dc:creator><![CDATA[asmitaw]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/asmitaw/2009/08/05/replication-using-custom-mapping-and-custom-table-create-scripts-for-non-sql-subscriber-applies-to-sql-server-2005-and-2008/</guid>
      <description><![CDATA[Replication using custom mapping AND custom table create scripts for NON SQL subscriber - Applies to...]]></description>
      <content:encoded><![CDATA[<p><b>Replication using custom mapping AND custom table create scripts for NON SQL subscriber - </b>Applies to SQL server 2005 and 2008 </p>  <p>The purpose of this document is to demonstrate how SQL Server replication can be directed to use custom mapping while copying data to NON-SQL database.</p>  <p>This document requires the audience to know SQL server management. Replication and types of replication. It also requires you to SQL programming knowledge of DB2 database. That will be our example NON –SQL database.</p>  <p><b>Sample database:</b></p>  <p>In our example we will replicate two columns from Categories table of NorthWind database. Northwind database can be downloaded from <a href="https://www.microsoft.com/downloads/details.aspx?FamilyID=06616212-0356-46A0-8DA2-EEBC53A68034&amp;displaylang=en">https://www.microsoft.com/downloads/details.aspx?FamilyID=06616212-0356-46A0-8DA2-EEBC53A68034&amp;displaylang=en</a></p>  <p>Original table definition for Categories table is like this:</p>  <p>Table create</p>  <p>USE [Northwind]</p>  <p>GO</p>  <p>/****** Object: Table [dbo].[Categories] Script Date: 08/03/2009 11:05:36 ******/</p>  <p>SET ANSI_NULLS ON</p>  <p>GO</p>  <p>SET QUOTED_IDENTIFIER ON</p>  <p>GO</p>  <p>CREATE TABLE [dbo].[Categories](</p>  <p><b>[CategoryID] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,</b></p>  <p>[CategoryName] [nvarchar](15) NOT NULL,</p>  <p><b>[Description] [ntext] NULL,</b></p>  <p>[Picture] [image] NULL,</p>  <p>CONSTRAINT [PK_Categories] PRIMARY KEY CLUSTERED</p>  <p>(</p>  <p>[CategoryID] ASC</p>  <p>)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]</p>  <p>) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]</p>  <p>Create a Snapshot publication for Article Categories. Select only two columns from Categories as the columns to be replicated - those are CategoryID and Description. Create a NON-SQL subscriber using </p>  <p><b>Create a Snapshot publication and NON-SQL subscriber:</b></p>  <p>Following steps will guide you through creating simple snapshot publication. Note that the security method selected is not recommended one. Your organisation may need more strict security and please alter your publication accordingly.</p>  <p><b><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image002_2.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image002_2.jpg"><img title="clip_image002" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="179" alt="clip_image002" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image002_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image002_thumb.jpg" width="244" border="0" /></a></b></p>  <p><b></b></p>  <p><b><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image004_2.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image004_2.jpg"><img title="clip_image004" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="219" alt="clip_image004" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image004_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image004_thumb.jpg" width="244" border="0" /></a></b></p>  <p><b></b></p>  <p><b><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image006_2.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image006_2.jpg"><img title="clip_image006" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="219" alt="clip_image006" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image006_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image006_thumb.jpg" width="244" border="0" /></a></b></p>  <p><b></b></p>  <p><b><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image008_2.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image008_2.jpg"><img title="clip_image008" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="219" alt="clip_image008" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image008_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image008_thumb.jpg" width="244" border="0" /></a></b></p>  <p><b></b></p>  <p><b><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image010_2.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image010_2.jpg"><img title="clip_image010" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="219" alt="clip_image010" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image010_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image010_thumb.jpg" width="244" border="0" /></a></b></p>  <p><b></b></p>  <p><b><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image012_2.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image012_2.jpg"><img title="clip_image012" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="219" alt="clip_image012" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image012_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image012_thumb.jpg" width="244" border="0" /></a></b></p>  <p><b></b></p>  <p><b><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image014_2.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image014_2.jpg"><img title="clip_image014" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="219" alt="clip_image014" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image014_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image014_thumb.jpg" width="244" border="0" /></a></b></p>  <p><b></b></p>  <p><b><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image016_2.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image016_2.jpg"><img title="clip_image016" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="210" alt="clip_image016" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image016_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image016_thumb.jpg" width="244" border="0" /></a></b></p>  <p><b></b></p>  <p><b><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image018_2.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image018_2.jpg"><img title="clip_image018" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="219" alt="clip_image018" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image018_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image018_thumb.jpg" width="244" border="0" /></a></b></p>  <p><b></b></p>  <p><b><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image020_2.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image020_2.jpg"><img title="clip_image020" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="219" alt="clip_image020" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image020_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image020_thumb.jpg" width="244" border="0" /></a></b></p>  <p><b></b></p>  <p><b><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image022_2.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image022_2.jpg"><img title="clip_image022" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="219" alt="clip_image022" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image022_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image022_thumb.jpg" width="244" border="0" /></a></b></p>  <p><b></b></p>  <p><b><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image024_2.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image024_2.jpg"><img title="clip_image024" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="219" alt="clip_image024" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image024_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image024_thumb.jpg" width="244" border="0" /></a></b></p>  <p><b>Creating subscription:</b></p>  <p><b></b></p>  <p><b><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image026_2.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image026_2.jpg"><img title="clip_image026" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="184" alt="clip_image026" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image026_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image026_thumb.jpg" width="244" border="0" /></a><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image028_2.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image028_2.jpg"><img title="clip_image028" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="219" alt="clip_image028" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image028_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image028_thumb.jpg" width="244" border="0" /></a></b></p>  <p><b></b></p>  <p><b><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image030_2.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image030_2.jpg"><img title="clip_image030" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="219" alt="clip_image030" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image030_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image030_thumb.jpg" width="244" border="0" /></a></b></p>  <p><b></b></p>  <p><b><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image032_2.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image032_2.jpg"><img title="clip_image032" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="219" alt="clip_image032" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image032_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image032_thumb.jpg" width="244" border="0" /></a></b></p>  <p><b></b></p>  <p><b><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image034_2.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image034_2.jpg"><img title="clip_image034" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="184" alt="clip_image034" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image034_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image034_thumb.jpg" width="244" border="0" /></a></b></p>  <p><b></b></p>  <p><b></b></p>  <p><b><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image036_2.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image036_2.jpg"><img title="clip_image036" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="184" alt="clip_image036" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image036_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image036_thumb.jpg" width="244" border="0" /></a> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image038_2.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image038_2.jpg"><img title="clip_image038" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="113" alt="clip_image038" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image038_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image038_thumb.jpg" width="244" border="0" /></a></b></p>  <p><b></b></p>  <p><b></b></p>  <p><b><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image040_2.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image040_2.jpg"><img title="clip_image040" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="219" alt="clip_image040" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image040_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image040_thumb.jpg" width="244" border="0" /></a></b></p>  <p><b></b></p>  <p><b></b></p>  <p><b>DB2OLEDB provider connection string looks like this: </b></p>  <p><b>Provider=DB2OLEDB;User ID=XXXXXX;Password=******;Initial Catalog=YYYYYY;Network Transport Library=TCP;Host CCSID=37;PC Code Page=1252;Network Address=YYYYYY;Network Port=446;Package Collection=XXXXXX;Default Schema=XXXXXX;Process Binary as Character=True;Units of Work=RUW;DBMS Platform=DB2/AS400;Defer Prepare=False;Rowset Cache Size=0;Authentication=Server;Persist Security Info=True;Connection Pooling=True;Derive Parameters=False;</b></p>  <p><b></b></p>  <p><b></b></p>  <p><b><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image042_2.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image042_2.jpg"><img title="clip_image042" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="244" alt="clip_image042" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image042_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image042_thumb.jpg" width="199" border="0" /></a></b></p>  <p><b></b></p>  <p><b>     <br /></b></p>  <p><b></b></p>  <p><b><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image044_2.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image044_2.jpg"><img title="clip_image044" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="219" alt="clip_image044" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image044_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image044_thumb.jpg" width="244" border="0" /></a></b></p>  <p><b></b></p>  <p><b><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image046_2.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image046_2.jpg"><img title="clip_image046" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="219" alt="clip_image046" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image046_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image046_thumb.jpg" width="244" border="0" /></a></b></p>  <p><b></b></p>  <p><b><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image048_2.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image048_2.jpg"><img title="clip_image048" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="219" alt="clip_image048" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image048_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image048_thumb.jpg" width="244" border="0" /></a></b></p>  <p><b></b></p>  <p><b><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image050_2.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image050_2.jpg"><img title="clip_image050" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="219" alt="clip_image050" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image050_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image050_thumb.jpg" width="244" border="0" /></a></b></p>  <p><b></b></p>  <p><b>Determining supported mappings for your remote DBMS:</b></p>  <p>SQL server has a mappings table that keeps track of what all source data types can be mapped to what all destination data types on different DBMS platforms. For e.g. Following query retrieves all the mappings for DB2 as a destination dbms :</p>  <p>select * from msdb.dbo.sysdatatypemappings</p>  <p>where destination_dbms ='DB2'</p>  <p>And following query does find all the mappings for DB2 for source SQL data type = next:</p>  <p>select * from msdb.dbo.sysdatatypemappings</p>  <p>where source_type= 'ntext' AND destination_dbms ='DB2'</p>  <p>If desired custom mapping does not exist then use sp_adddatatypemapping to define one, something like in e.g. below:</p>  <p>--if above query does not return anything then add maping yourself using something like below </p>  <p>exec sp_adddatatypemapping</p>  <p>@source_dbms= 'MSSQLSERVER',</p>  <p>@destination_dbms='DB2', @source_type = 'ntext',</p>  <p>@destination_type='VARCHAR', @destination_length=32703</p>  <p><b>Setting the Article properties to use custom create TABLE script :</b></p>  <p>Once you verify or create required mapping, we need to tell replication as to how to use this mapping. SQL server allows this through stored procedure sp_changearticle.</p>  <p>More reference on sp_changearticle can be found at: <a href="https://msdn.microsoft.com/en-us/library/ms175980(SQL.90).aspx">https://msdn.microsoft.com/en-us/library/ms175980(SQL.90).aspx</a></p>  <p>--set the creation_script property of Article to point to custom Create Script</p>  <p>sp_changearticle @publication = SUBREPL,</p>  <p>@article = Categories,</p>  <p>@property = 'creation_script',</p>  <p>@value = &quot;d:\TEMP\RFC4789\SUBREPL.sql&quot;,</p>  <p>@force_invalidate_snapshot = 1,</p>  <p>@force_reinit_subscription = 1</p>  <p>-- then change the Schema option.</p>  <p>DECLARE @option AS int;</p>  <p>SET @option = (SELECT CAST(0x00 AS int));</p>  <p>EXEC sp_changearticle @publication = SUBREPL,</p>  <p>@article = Categories,</p>  <p>@property = N'schema_option',</p>  <p>@value = @option,</p>  <p>@force_invalidate_snapshot = 1,</p>  <p>@force_reinit_subscription = 1</p>  <p>We have changed the Article properties by doing above two steps, now its time to discuss our e.g. Script SUBREPL.sql that creates the TABLE. Since we want this Article to be replicated on DB2, it is required to use DB2’s sql syntax.</p>  <p>e.g. our SUBREPL.sql contains following commands in it to create table and index on it. Note that this is DB2 syntax for OS/400. bypass_translation is required to be mentioned in the script so that publication will not translate the syntax of any queries that follows. </p>  <p>bypass_translation</p>  <p>DROP TABLE CATEGORIES</p>  <p>GO</p>  <p>CREATE TABLE CATEGORIES (</p>  <p>CATEGORYID INT NOT NULL,</p>  <p>DESCRIPTION VARCHAR (32703))</p>  <p>GO</p>  <p>CREATE UNIQUE INDEX PK_CATEGORIES ON CATEGORIES (CATEGORYID)</p>  <p>GO</p>  <p><b>Match cases on object names:</b></p>  <p><b>Because DB2 is case sensitive</b> we will make sure that Article property &quot;Destination Object Name&quot; is set to correct one . It has to be in the same case as it appears in the SUBREPL.sql Script</p>  <p>See the following screenshot:</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image052_2.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image052_2.jpg"><img title="clip_image052" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="219" alt="clip_image052" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image052_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image052_thumb.jpg" width="244" border="0" /></a></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image054_2.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image054_2.jpg"><img title="clip_image054" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="184" alt="clip_image054" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image054_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/asmitaw/WindowsLiveWriter/ReplicationusingcustommappingANDcustomta_8762/clip_image054_thumb.jpg" width="244" border="0" /></a></p>  <p>That’s it you replication is set to go from ntext to VARCHAR using custom CREATE script.</p>]]></content:encoded>
    </item>
    <item>
      <title>How to get DB2 ServerClass and ServerVersion for your DB2 instance.</title>
      <link>https://docs.microsoft.com/archive/blogs/asmitaw/how-to-get-db2-serverclass-and-serverversion-for-your-db2-instance</link>
      <pubDate>Wed, 08 Jul 2009 19:08:00 GMT</pubDate>
      <dc:creator><![CDATA[asmitaw]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/asmitaw/2009/07/08/how-to-get-db2-serverclass-and-serverversion-for-your-db2-instance/</guid>
      <description><![CDATA[...]]></description>
      <content:encoded><![CDATA[
<STYLE type=text/css>

 p.MsoNormal
	{margin-top:0in;
	margin-right:0in;
	margin-bottom:10.0pt;
	margin-left:0in;
	line-height:115%;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	}
    </STYLE>

<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">here is code snippet using DataAccessLibrary that ships with :</P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">1. Microsoft Host Integration Server AND</P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">2. Microsoft Biztalk Adapters for Host Systems AND</P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">3. Microsoft's DB2OLEDB (SQL server feature pack for DB2 ) .</P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">if you have any of these , following code will help getting&nbsp; your DB2 server's version and class ( MVS or AS400 or NT etc.)</P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none" mce_keep="true">&nbsp;</P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none" mce_keep="true">&nbsp;</P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes">//referencesspan style="mso-spacerun:yes"&gt;&nbsp; </SPAN>required to be added in your project - Microsoft.HostIntegration.DataAccessLibrary.dll <?xml:namespace prefix = o /><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes">using</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"> System;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes">using</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"> Microsoft.HostIntegration.DataAccessLibrary;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes">using</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"> System.Diagnostics;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes">namespace</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"> ConsoleApplication1<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes">{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">class</SPAN> <SPAN style="COLOR: #2b91af">Program<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">static</SPAN> <SPAN style="COLOR: blue">void</SPAN> Main(<SPAN style="COLOR: blue">string</SPAN>[] args)<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">string</SPAN> serverClass = <SPAN style="COLOR: #2b91af">String</SPAN>.Empty;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">string</SPAN> serverVersion = <SPAN style="COLOR: #2b91af">String</SPAN>.Empty;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">try<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: #2b91af">DataAccessControl</SPAN> control = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">DataAccessControl</SPAN>();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: green">//DB2.UDL is the connection to DB2 server( Created with DAT- Data Access Tool)<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: #2b91af">IConnectionString</SPAN> cnstr = <SPAN style="COLOR: #2b91af">DB2OleDbConnectionString</SPAN>.ReadUDL(<SPAN style="COLOR: #a31515">@"DB2.UDL"</SPAN>);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: #2b91af">DataAccessControl</SPAN>.TestConnection(cnstr, <SPAN style="COLOR: blue">out</SPAN> serverClass, <SPAN style="COLOR: blue">out</SPAN> serverVersion);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: #2b91af">Console</SPAN>.WriteLine(<SPAN style="COLOR: #a31515">"serverClass"</SPAN> + serverClass);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: #2b91af">Console</SPAN>.WriteLine(<SPAN style="COLOR: #a31515">"serverVersion"</SPAN> + serverVersion);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">catch</SPAN>(Microsoft.HostIntegration.DataAccessLibrary.<SPAN style="COLOR: #2b91af">ConnectionException</SPAN> e)<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: #2b91af">Console</SPAN>.WriteLine(<SPAN style="COLOR: #a31515">"failed to connect "</SPAN> + e.ToString());<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes">}<o:p></o:p></SPAN></P>
<P class=MsoNormal><o:p>&nbsp;</o:p></P>]]></content:encoded>
    </item>
    <item>
      <title>ADO.net provider for AS400/VSAM files in OFFLINE mode</title>
      <link>https://docs.microsoft.com/archive/blogs/asmitaw/ado-net-provider-for-as400vsam-files-in-offline-mode</link>
      <pubDate>Mon, 22 Jun 2009 20:14:00 GMT</pubDate>
      <dc:creator><![CDATA[asmitaw]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/asmitaw/2009/06/22/ado-net-provider-for-as400vsam-files-in-offline-mode/</guid>
      <description><![CDATA[p.MsoNormal
	{margin-bottom:.0001pt;
	font-size:10.0pt;
	font-family:"Times New...]]></description>
      <content:encoded><![CDATA[
<STYLE type=text/css>

 p.MsoNormal
	{margin-bottom:.0001pt;
	font-size:10.0pt;
	font-family:"Times New Roman","serif";
	        margin-left: 0in;
            margin-right: 0in;
            margin-top: 0in;
        }
a:link
	{color:blue;
	text-decoration:underline;
	text-underline:single;
        }
 table.MsoNormalTable
	{font-size:10.0pt;
	font-family:"Times New Roman","serif";
        }
span.MsoSubtleReference
	{font-variant:small-caps;
	color:#C0504D;
	text-decoration:underline;
	text-underline:single;
        }
ul
	{margin-bottom:0in;}
 li.MsoNormal
	{margin-bottom:.0001pt;
	font-size:10.0pt;
	font-family:"Times New Roman","serif";
	        margin-left: 0in;
            margin-right: 0in;
            margin-top: 0in;
        }
p.MsoListParagraphCxSpFirst
	{margin-top:2.0pt;
	margin-right:0in;
	margin-bottom:0in;
	margin-left:.5in;
	margin-bottom:.0001pt;
	font-size:9.0pt;
	font-family:"Arial","sans-serif";
	}
p.MsoListParagraphCxSpMiddle
	{margin-top:0in;
	margin-right:0in;
	margin-bottom:0in;
	margin-left:.5in;
	margin-bottom:.0001pt;
	font-size:9.0pt;
	font-family:"Arial","sans-serif";
	}
p.MsoListParagraphCxSpLast
	{margin-top:0in;
	margin-right:0in;
	margin-bottom:2.0pt;
	margin-left:.5in;
	font-size:9.0pt;
	font-family:"Arial","sans-serif";
	}
p.MsoHeader
	{margin-bottom:.0001pt;
	tab-stops:center 3.0in right 6.0in;
	font-size:10.0pt;
	font-family:"Times New Roman","serif";
	        margin-left: 0in;
            margin-right: 0in;
            margin-top: 0in;
        }
    </STYLE>

<P><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">Just thought&nbsp;of writing a quick post on this new feature that&nbsp;ships&nbsp;with HIS 2009. <?xml:namespace prefix = o /><o:p></o:p></SPAN></P>
<P><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">To give some introduction&nbsp;about this provider -&nbsp;HIS 2006 ships with first version of ADO.net provider for mainframe and AS400 files systems. At the time product required&nbsp;to have live&nbsp;connection to Host&nbsp; to read the data from VSAM files and AS400 files. Because of popular demand of supporting the&nbsp;SQL&nbsp;on predownloded binary files, HIS 2009 now supports this provider in OFFLINE mode. <o:p></o:p></SPAN></P>
<P><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">1) ADVOFFLINE is a OFFLINE file ( VSAM or AS400 file&nbsp;that&nbsp; is FTP'd in BINARY format&nbsp;to a windows workstation ).<o:p></o:p></SPAN></P>
<P><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">2) Lib_ADV.dll - &nbsp;Metadata assembly&nbsp;that defines record structure(s)&nbsp;that a ADVOFFLINE can have.<o:p></o:p></SPAN></P>
<P><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">3) ADVCOPY - is a copybook for the&nbsp;original ONLINE VSAM file.<o:p></o:p></SPAN></P>
<P><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">4) program.cs is&nbsp;a sample that does a&nbsp;SELECT ON a&nbsp;ADVOFFLINE.<o:p></o:p></SPAN></P>
<P mce_keep="true"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">program.cs code :<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes">using</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"> System;<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes">using</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"> System.Collections.Generic;<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes">using</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"> System.Linq;<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes">using</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"> System.Text;<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes">using</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"> Microsoft.HostIntegration.MsHostFileClient;<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes">using</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"> System.IO;<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes">using</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"> System.Reflection;<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes">using</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"> System.Data;<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes">namespace</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"> OFFLINEUnions<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes">{<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">class</SPAN> <SPAN style="COLOR: #2b91af">Program<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">static</SPAN> <SPAN style="COLOR: blue">void</SPAN> Main(<SPAN style="COLOR: blue">string</SPAN>[] args)<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">string</SPAN> cnstring = <SPAN style="COLOR: #a31515">@"Local Folder=C:\HisTests\DataTests\OFFLINE;Metadata=C:\HISTests\DataTests\Binaries\HostFileProvider\Lib_ADV.DLL"</SPAN>; <o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: #2b91af">HostFileConnection</SPAN> cn = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">HostFileConnection</SPAN>(cnstring);<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">try<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: #2b91af">Assembly</SPAN> HostFileMetadata<SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>= <SPAN style="COLOR: #2b91af">Assembly</SPAN>.LoadFile(<SPAN style="COLOR: #a31515">@"c:\histests\DataTests\Binaries\HostFileProvider\Lib_ADV.DLL"</SPAN>);<SPAN style="mso-spacerun: yes">&nbsp; </SPAN><o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>cn.Metadata = HostFileMetadata;<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>cn.Open();<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: #2b91af">HostFileCommand</SPAN> cm2 = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">HostFileCommand</SPAN>(cn);<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>cm2.CommandText = <SPAN style="COLOR: #a31515">"SELECT * from ADVOFFLINE as Lib_ADV.OUT_FILE_REC1"</SPAN>; <o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: #2b91af">HostFileRecordSet</SPAN> hfrs = cm2.ExecuteRecordSet();<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: #2b91af">StreamWriter</SPAN> ADVstream = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">StreamWriter</SPAN>(<SPAN style="COLOR: #a31515">@"c:\Histests\datatests\Scripts\SELECT_ADV.txt"</SPAN> );<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">while</SPAN> (hfrs.Read())<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ADVstream.WriteLine(hfrs.GetString(0));<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">int</SPAN> lev88_colNumber = hfrs.GetOrdinal(<SPAN style="COLOR: #a31515">"OUT1_LEV88"</SPAN>);<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ADVstream.WriteLine(hfrs.GetInt16(lev88_colNumber));<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">if</SPAN> (hfrs.GetInt16(lev88_colNumber).Equals(1))<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>System.<SPAN style="COLOR: #2b91af">Console</SPAN>.WriteLine(hfrs.GetString(hfrs.GetOrdinal(<SPAN style="COLOR: #a31515">"UNION1"</SPAN>)));<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ADVstream.WriteLine(hfrs.GetString(hfrs.GetOrdinal(<SPAN style="COLOR: #a31515">"UNION1"</SPAN>)));<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">if</SPAN> (hfrs.GetInt16(lev88_colNumber).Equals(2))<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ADVstream.WriteLine(hfrs.GetDecimal(hfrs.GetOrdinal(<SPAN style="COLOR: #a31515">"UNION1"</SPAN>)).ToString());<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">if</SPAN> (hfrs.GetInt16(lev88_colNumber).Equals(3))<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: #2b91af">HostFileRecordSet</SPAN> _unionshfrs = (<SPAN style="COLOR: #2b91af">HostFileRecordSet</SPAN>)hfrs.GetRecordSet(hfrs.GetOrdinal(<SPAN style="COLOR: #a31515">"UNION1"</SPAN>));<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">while</SPAN> (_unionshfrs.Read())<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ADVstream.WriteLine(_unionshfrs.GetInt16(_unionshfrs.GetOrdinal(<SPAN style="COLOR: #a31515">"OUT1_SMALL1"</SPAN>)).ToString());<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ADVstream.WriteLine(_unionshfrs.GetString(_unionshfrs.GetOrdinal(<SPAN style="COLOR: #a31515">"OUT1_SMALL2"</SPAN>)));<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ADVstream.WriteLine(_unionshfrs.GetInt16(_unionshfrs.GetOrdinal(<SPAN style="COLOR: #a31515">"OUT1_SMALL3"</SPAN>)).ToString());<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>_unionshfrs.Close();<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: #2b91af">HostFileRecordSet</SPAN> _unionsnumbershfrs = (<SPAN style="COLOR: #2b91af">HostFileRecordSet</SPAN>)hfrs.GetRecordSet(hfrs.GetOrdinal(<SPAN style="COLOR: #a31515">"OUT1_NUMBERS"</SPAN>));<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">while</SPAN> (_unionsnumbershfrs.Read())<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">string</SPAN> logvalue = _unionsnumbershfrs.GetInt32(_unionsnumbershfrs.GetOrdinal(<SPAN style="COLOR: #a31515">"OUT1_LEADING"</SPAN>)).ToString();<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ADVstream.WriteLine(logvalue);<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>logvalue = _unionsnumbershfrs.GetInt32(_unionsnumbershfrs.GetOrdinal(<SPAN style="COLOR: #a31515">"OUT1_TRAILING"</SPAN>)).ToString();<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ADVstream.WriteLine(logvalue);<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>logvalue = _unionsnumbershfrs.GetInt32(_unionsnumbershfrs.GetOrdinal(<SPAN style="COLOR: #a31515">"OUT1_SEPALEAD"</SPAN>)).ToString();<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>ADVstream.WriteLine(logvalue);<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>logvalue = _unionsnumbershfrs.GetInt32(_unionsnumbershfrs.GetOrdinal(<SPAN style="COLOR: #a31515">"OUT1_SEPATRAI"</SPAN>)).ToString();<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ADVstream.WriteLine(logvalue);<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>hfrs.Close();<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ADVstream.Close();<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">catch</SPAN> (<SPAN style="COLOR: #2b91af">Exception</SPAN> e)<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: #2b91af">Console</SPAN>.WriteLine(e.ToString());<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">finally<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">if</SPAN> (cn.State.Equals(<SPAN style="COLOR: #2b91af">ConnectionState</SPAN>.Open))<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>cn.Close();<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes">}<o:p></o:p></SPAN></P>
<P class=MsoNormal><o:p>&nbsp;</o:p></P>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/79/85/50/Lib_ADV.DLL" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-09-79-85-50/Lib_5F00_ADV.DLL">Lib_ADV.DLL</a></p>]]></content:encoded>
    </item>
    <item>
      <title>WCF web Service - Hosting in IIS 6.0 with Windows Authentication and Web client impersonation</title>
      <link>https://docs.microsoft.com/archive/blogs/asmitaw/wcf-web-service-hosting-in-iis-6-0-with-windows-authentication-and-web-client-impersonation</link>
      <pubDate>Mon, 15 Jun 2009 01:44:00 GMT</pubDate>
      <dc:creator><![CDATA[asmitaw]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/asmitaw/2009/06/15/wcf-web-service-hosting-in-iis-6-0-with-windows-authentication-and-web-client-impersonation/</guid>
      <description><![CDATA[As we all know, Hosting a WCF service and configuring authentication is not the same as we do for...]]></description>
      <content:encoded><![CDATA[<P>As we all know, Hosting a WCF service and configuring authentication is not the same as we do for ASMX. There are many changes and the way we get credentials in service code and on server etc. I am not going to get deep into it, <A title="THIS LINK" href="https://www.leastprivilege.com/HostingWCFServicesInASPNETTheSurvivalGuide.aspx" target=_blank mce_href="https://www.leastprivilege.com/HostingWCFServicesInASPNETTheSurvivalGuide.aspx"><STRONG>THIS LINK</STRONG></A> however here is another blog post which talks in great details about it hosting WCF service in IIS.</P>
<P>There is a small / Big (?) difference between ASMX and WCF with respect to hosting, and interestingly there is a compatibility mode for this same, <A title="THIS ARTICLE" href="https://blogs.msdn.com/wenlong/archive/2006/01/23/516041.aspx" target=_blank mce_href="https://blogs.msdn.com/wenlong/archive/2006/01/23/516041.aspx"><EM><STRONG>THIS ARTICLE</STRONG></EM></A> is great read on it. </P>
<P>&nbsp;Now, without wasting much of time, here is the problem in hand.&nbsp;</P>
<P>1. Need to create a WCF service which access Data Base </P>
<P>2. Then host it in IIS 6.0 (not IIS 7.0)</P>
<P>3. Make it Windows integrated Authentication</P>
<P>&nbsp;4. Build an ASP.NET&nbsp;client and consume service. </P>
<P>&nbsp;Simple enough? Interestingly there are some tweaks,</P>
<P>&nbsp;Here are the steps. <U>(I am using windows 2003 server and Visual studio 2008 with Sp1 and .NET framework 3.5)</U></P>
<P>1. With Visual studio, Create a WCF web service. </P>
<P>2. In IIS 6.0 create a different app pool and use that App pool for this service, Turn on the Windows integrated Auth and uncheck the Anonymous auth (For all the documents and pages or whatever)</P>
<P>3. Then edit the endpoint configuration. You need to use basicHTTPBinding, Here is the code snippet inside the service model tag</P><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<BLOCKQUOTE>
<P>&lt;</FONT></FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>system.serviceModel</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>&gt;</P>
<P>&lt;</FONT></FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>bindings</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>&gt;</P>
<P>&lt;</FONT></FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>basicHttpBinding</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>&gt;</P>
<P>&lt;</FONT></FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>binding</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2> </FONT></FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>name</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>=</FONT></FONT><FONT size=2>"</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>BasicHttpEndPointBinding</FONT></FONT><FONT size=2>"</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>&gt;</P>
<P>&lt;</FONT></FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>security</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2> </FONT></FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>mode</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>=</FONT></FONT><FONT size=2>"</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>TransportCredentialOnly</FONT></FONT><FONT size=2>"</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>&gt;</P>
<P>&lt;</FONT></FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>transport</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2> </FONT></FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>clientCredentialType</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>=</FONT></FONT><FONT size=2>"</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Windows</FONT></FONT><FONT size=2>"</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>/&gt;</P>
<P>&lt;/</FONT></FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>security</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>&gt;</P>
<P>&lt;/</FONT></FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>binding</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>&gt;</P>
<P>&lt;/</FONT></FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>basicHttpBinding</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>&gt;</P>
<P>&lt;/</FONT></FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>bindings</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>&gt;</P></BLOCKQUOTE></FONT></FONT>
<P>4. Once this is done, try debugging the service by requesting the .SVC file. You should get a credential prompt. Everything work fine till here.</P>
<P>5. Create a ASP.NET web app, turn on windows Auth and turn off Anonymous auth. Create a service ref and write a code to access the service. </P>
<P>6. Now here is the interesting part. In most of the cases, you will have a service account which has given the access to DB, and you would like web service to run under that user account. To do this you would go and run the app pool created for WCF service under service account (This is the AD account). Once you do the the application pool will crash saying the user identity should be in SPN. (Need to make changes on Domain controller and all)</P>
<P>7. The above is not the part of solution, so here is what you do, Enable the IIS metabase edit enabled. </P>
<P>8. Open the IIS metadata file wich is in System32/inetsrv/metabase.xml and find IISWebServer tag in there corrosponding to&nbsp; you app pool name. Add this in there <STRONG>NTAuthenticationProviders="</STRONG>Negotiate<STRONG>,NTLM"</STRONG></P>
<P>9. Close the IIS metabase xml file and restart the IIS. After doing this, Add this&nbsp;service account to IIS_WPG account. This is very important. Also you do not want &lt;identity impersonate = "true"&gt; for your service.</P>
<P>10. Now, on the client side (Your web app) if you are using the same app pool with Windows Auth, then it will work only on your local machine (Hop Problem), So for web application user the default app pool with network service as user.</P>
<P>You should be good now. </P>
<P mce_keep="true">&nbsp;</P>
<P mce_keep="true">&nbsp;</P>]]></content:encoded>
    </item>
    <item>
      <title>Mainframe - Printing the job(JCL) output to a file</title>
      <link>https://docs.microsoft.com/archive/blogs/asmitaw/mainframe-printing-the-jobjcl-output-to-a-file</link>
      <pubDate>Tue, 19 May 2009 12:34:00 GMT</pubDate>
      <dc:creator><![CDATA[asmitaw]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/asmitaw/2009/05/19/mainframe-printing-the-jobjcl-output-to-a-file/</guid>
      <description><![CDATA[Sometimes we&nbsp; want to preserve the output of jobs ( JCL ) run sucessfully so that we can refer...]]></description>
      <content:encoded><![CDATA[<P>Sometimes we&nbsp; want to preserve the output of jobs ( JCL ) run sucessfully so that we can refer to them in future. The way I like to use these&nbsp;results is to convince my mainframe Admin that I am referring to the&nbsp;correct&nbsp; environment settings and the job log saved previously is the benchmark that we compare against.</P>
<P>The other&nbsp;way to&nbsp;make use of this log information is if your shop face&nbsp; the similar upgrade issues over and over you can refer to failed&nbsp;jobs for failure messages, return codes&nbsp; etc.</P>
<P>these&nbsp;are&nbsp;the steps that&nbsp;would work for most of the shops:</P>
<P>1) go to the SDSF panel </P>
<P>2) locate the job you want to copy</P>
<P>3) in the command line print XD</P>
<P>4) this will pull&nbsp; the&nbsp; SDSF&nbsp; open print dataset&nbsp; , which looks like :</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SDSF Open Print Data Set&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;COMMAND INPUT ===&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SCROLL ===&gt; CSR&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;Data set name&nbsp; ===&gt; 'HQ.SPROC.OUT'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;Member to use&nbsp; ===&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;Disposition&nbsp;&nbsp;&nbsp; ===&gt; NEW&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (OLD, NEW, SHR, MOD)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;If the data set is to be created, specify the following.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;Volume serial will be used to locate existing data sets if specified.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;Management class&nbsp;&nbsp;&nbsp;&nbsp; ===&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Blank for default management class)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;Storage class&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ===&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Blank for default storage class)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp; Volume serial&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ===&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Blank for authorized default volume)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp; Device type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ===&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Generic unit or device address)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;Data class&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ===&gt; DBCLASS&nbsp;&nbsp; (Blank for default data class)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp; Space units&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ===&gt; TRKS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (BLKS, TRKS, CYLS, BY, KB, or MB)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp; Primary quantity&nbsp;&nbsp; ===&gt; 75&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (In above units)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp; Secondary quantity ===&gt; 5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (In above units)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp; Directory blocks&nbsp;&nbsp; ===&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Zero for sequential data set)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp; Record format&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ===&gt; VBA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp; Record length&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ===&gt; 240&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp; Block size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ===&gt; 3120&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR></P>
<P>5)&nbsp; hit enter, it will take you to the&nbsp; SDSF again. On the command line&nbsp;print "PRINT CLOSE" and hit enter.</P>
<P>6)&nbsp; Now you should be able to see the job log captured in dataset - 'HQ.SPROC.OUT'</P>
<P>thanks !</P>
<P mce_keep="true">&nbsp;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </P>
<P mce_keep="true">&nbsp;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;</P>]]></content:encoded>
    </item>
    <item>
      <title>Validating Image File for Content Type with ASP.NET FileUpload web control.</title>
      <link>https://docs.microsoft.com/archive/blogs/asmitaw/validating-image-file-for-content-type-with-asp-net-fileupload-web-control</link>
      <pubDate>Thu, 18 Sep 2008 17:30:00 GMT</pubDate>
      <dc:creator><![CDATA[asmitaw]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/asmitaw/2008/09/18/validating-image-file-for-content-type-with-asp-net-fileupload-web-control/</guid>
      <description><![CDATA[We use file upload web control in our sites, where we want only valid image types to be...]]></description>
      <content:encoded><![CDATA[<P>We use file upload web control in our sites, where we want only valid image types to be uploaded.</P>
<P>Without talking much -&gt;&nbsp;here are&nbsp;3 ways to do it.</P>
<P><STRONG>1.</STRONG> Accept attribute of fileUpload control&nbsp;- Doesnt work with most of the browsers (Bad with IE itself)</P>
<P><STRONG>2.</STRONG> Regular Expression validator for FileUpload </P>
<BLOCKQUOTE>
<P><STRONG>&lt;asp:RegularExpressionValidator id="UpLoadValidator" runat="server" ErrorMessage="Upload Images only." ValidationExpression="^(([a-zA-Z]:)|(</STRONG><A href="file://%7b2%7d/w+)/$?)(\\(\w[\w].*))(.jpg|.png|.bmp|.jpeg|.gif)$" mce_href="file://%7b2%7d/w+)/$?)(\\(\w[\w].*))(.jpg|.png|.bmp|.jpeg|.gif)$"><STRONG>\\{2}\w+)\$?)(\\(\w[\w].*))(.jpg|.png|.bmp|.jpeg|.gif)$</STRONG></A><STRONG>" ControlToValidate="FileUpload1"&gt; &lt;/asp:RegularExpressionValidator&gt;</STRONG></P>
<P><STRONG>This is Not very handy when using AJAX controls on page- Both javascripts dont like each other :) </STRONG></P></BLOCKQUOTE>
<P><STRONG>3.</STRONG> Write a code behind function in a very simple way - Most robust way to use it. - Very Generic can be used for any file types.</P><FONT size=2>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>private</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>bool</FONT></FONT><FONT size=2> IsFileValid()</P>
<P>{</P>
<BLOCKQUOTE>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>string</FONT></FONT><FONT size=2> [] allowedImageTyps = {</FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"image/gif"</FONT></FONT><FONT size=2>, </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"image/pjpeg"</FONT></FONT><FONT size=2>, </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"image/bmp"</FONT></FONT><FONT size=2>,</FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"image/x-png"</FONT></FONT><FONT size=2>};</P>
<P></FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>StringCollection</FONT></FONT><FONT size=2> imageTypes = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>new</FONT></FONT><FONT size=2> </FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>StringCollection</FONT></FONT><FONT size=2>();</P>
<P>imageTypes.AddRange(allowedImageTyps);</P>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>if</FONT></FONT><FONT size=2> (imageTypes.Contains(FileUpload1.PostedFile.ContentType))</P></BLOCKQUOTE>
<BLOCKQUOTE>
<BLOCKQUOTE>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>return</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>true</FONT></FONT><FONT size=2>;</P></BLOCKQUOTE></BLOCKQUOTE>
<BLOCKQUOTE>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>else</P></BLOCKQUOTE></FONT></FONT><FONT size=2>
<BLOCKQUOTE>
<P>{</P>
<BLOCKQUOTE>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>return</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>false</FONT></FONT><FONT size=2>;</P></BLOCKQUOTE>
<P>}</P></BLOCKQUOTE>
<P>}</P></FONT>
<P>&nbsp;NOTE - use FileUpload1.PostedFile.ContentType and not the file name to check the Extension </P>
<P mce_keep="true">Leave a comment if this helped you</P>
<P mce_keep="true">&nbsp;</P>
<P><STRONG></STRONG>&nbsp;</P>]]></content:encoded>
    </item>
    <item>
      <title>Microsoft OLEDB provider for DB2 Service pack 2 Released</title>
      <link>https://docs.microsoft.com/archive/blogs/asmitaw/microsoft-oledb-provider-for-db2-service-pack-2-released</link>
      <pubDate>Tue, 02 Sep 2008 20:41:00 GMT</pubDate>
      <dc:creator><![CDATA[asmitaw]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/asmitaw/2008/09/02/microsoft-oledb-provider-for-db2-service-pack-2-released/</guid>
      <description><![CDATA[I am excited to announce that SQL 2008 compatible version of DB2OLEDB provider&nbsp; is available...]]></description>
      <content:encoded><![CDATA[<P>I am excited to announce that SQL 2008 compatible version of DB2OLEDB provider&nbsp; is available for download at :</P>
<P><A href="https://www.microsoft.com/downloads/details.aspx?FamilyID=c6c3e9ef-ba29-4a43-8d69-a2bed18fe73c&amp;DisplayLang=en" mce_href="https://www.microsoft.com/downloads/details.aspx?FamilyID=c6c3e9ef-ba29-4a43-8d69-a2bed18fe73c&amp;DisplayLang=en">https://www.microsoft.com/downloads/details.aspx?FamilyID=c6c3e9ef-ba29-4a43-8d69-a2bed18fe73c&amp;DisplayLang=en</A></P>
<P>This provider&nbsp; supports new datatypes added&nbsp; in SQL 2008 .More details information on how&nbsp;the new datatypes correspond to OLEDB data types is available here :</P>
<P><A href="https://msdn.microsoft.com/en-us/library/ms175970.aspx" mce_href="https://msdn.microsoft.com/en-us/library/ms175970.aspx">https://msdn.microsoft.com/en-us/library/ms175970.aspx</A></P>
<P mce_keep="true">&nbsp;</P>]]></content:encoded>
    </item>
    <item>
      <title>Asmita Wankhede - Posts Other than Host integration server</title>
      <link>https://docs.microsoft.com/archive/blogs/asmitaw/asmita-wankhede-posts-other-than-host-integration-server</link>
      <pubDate>Tue, 02 Sep 2008 17:58:00 GMT</pubDate>
      <dc:creator><![CDATA[asmitaw]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/asmitaw/2008/09/02/asmita-wankhede-posts-other-than-host-integration-server/</guid>
      <description><![CDATA[This page is to get someting here]]></description>
      <content:encoded><![CDATA[This page is to get someting here]]></content:encoded>
    </item>
    <item>
      <title>First Impressions on Google Chrome Web Browser</title>
      <link>https://docs.microsoft.com/archive/blogs/asmitaw/first-impressions-on-google-chrome-web-browser</link>
      <pubDate>Tue, 02 Sep 2008 17:36:00 GMT</pubDate>
      <dc:creator><![CDATA[asmitaw]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/asmitaw/2008/09/02/first-impressions-on-google-chrome-web-browser/</guid>
      <description><![CDATA[Just thought to write about the Chrome web browser from Microsoft Developers perspective. 
Browser...]]></description>
      <content:encoded><![CDATA[<P>Just thought to write about the Chrome web browser from Microsoft Developers perspective. </P>
<P>Browser can be downloaded from <A href="https://www.google.com/chrome" mce_href="https://www.google.com/chrome">https://www.google.com/chrome</A></P>
<P>1.&nbsp; Silver light is not Supported&nbsp; (No Silverlight to start with)</P>
<P>2.&nbsp; Ajax toolkit project will not work as they work in IE. I have seen even IE8 breaks some functionality in AJAX enabled web pages.</P>
<P>3. You can debug/dump the JavaScript for a page as well as separate JavaScript console. </P>
<P>4. Basic problem from DEV perspective - Newlines are interpreted in much diff way in markup. Also Image (absolute)&nbsp; alignment are bit different.&nbsp; </P>
<P>Overall the browser is fast....feels much like&nbsp; Firefox. </P>
<P><BR>Things that I liked</P>
<P>1. No Window header (The Title of the Browser) Tabs start from (0x0) - maximizing the browse area</P>
<P>2. Caching is nice.</P>
<P>3. Creates the list of frequently visited site instead of Showing "You have just opened a new Tab" </P>
<P>4. Search and address bar are the same and gets very handy in 2 minutes.......no learning curve there.<BR></P>]]></content:encoded>
    </item>
    <item>
      <title>Sample : Executing i-series CL  commands using Host file Provider - MSHostFileClient.dll</title>
      <link>https://docs.microsoft.com/archive/blogs/asmitaw/sample-executing-i-series-cl-commands-using-host-file-provider-mshostfileclient-dll</link>
      <pubDate>Thu, 28 Aug 2008 14:42:00 GMT</pubDate>
      <dc:creator><![CDATA[asmitaw]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/asmitaw/2008/08/28/sample-executing-i-series-cl-commands-using-host-file-provider-mshostfileclient-dll/</guid>
      <description><![CDATA[Control language (CL)...]]></description>
      <content:encoded><![CDATA[<FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<P>Control language (CL) REFERENCES:</P>
<P><A href="https://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/rbam6/rbam6clmain.htm">https://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/rbam6/rbam6clmain.htm</A></P>
<P>C# sample :&nbsp;</P>
<P>using</FONT></FONT><FONT size=2> System;</FONT></P>
<P><FONT color=#0000ff size=2><FONT color=#0000ff size=2>using</FONT></FONT><FONT size=2> System.Collections.Generic;</P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<P>using</FONT></FONT><FONT size=2> System.Text;</P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<P>using</FONT></FONT><FONT size=2> Microsoft.HostIntegration.MsHostFileClient;</P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<P>namespace</FONT></FONT><FONT size=2> ConsoleApplication1</P>
<P>{</P>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>class</FONT></FONT><FONT size=2> </FONT><FONT color=#008080 size=2><FONT color=#008080 size=2>Program</P></FONT></FONT><FONT size=2>
<P>{</P>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>static</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>void</FONT></FONT><FONT size=2> Main(</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>string</FONT></FONT><FONT size=2>[] args)</P>
<P>{</P>
<P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>//connectionstring </P></FONT></FONT>
<P mce_keep="true"><FONT color=#0000ff size=2><FONT color=#0000ff size=2>string</FONT></FONT><FONT size=2> connectionstring = </FONT><FONT color=#800000 size=2><FONT color=#800000 size=2>"Provider=SNAOLEDB;User ID=USERID;Password=PASSWORD;APPC Remote LU Alias=RUSDFM;APPC Local LU Alias=P31680;APPC Mode Name=PA62TKNU;Network Transport Library=TCP;Host CCSID=37;PC Code Page=1252;Network Address=HOST;Network Port=PORTNUMBER;Process Binary as Character=False;Persist Security Info=True;Cache Authentication=False;Cache Authentication=False;Encrypt Password=False;Impersonation Level=Impersonate;Location=HOST;Protection Level=Connect;Default Library=USERID;Repair Host Keys=False;Strict Validation=False;Mask Password=False;"</FONT></FONT><FONT size=2>;</P>
<P></FONT><FONT color=#008080 size=2><FONT color=#008080 size=2>HostFileConnection</FONT></FONT><FONT size=2> cn = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>new</FONT></FONT><FONT size=2> </FONT><FONT color=#008080 size=2><FONT color=#008080 size=2>HostFileConnection</FONT></FONT><FONT size=2>(connectionstring);</P>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>try</P></FONT></FONT><FONT size=2>
<P>{</P>
<BLOCKQUOTE>
<P>cn.Open();</P>
<P></FONT><FONT color=#008080 size=2><FONT color=#008080 size=2>HostFileCommand</FONT></FONT><FONT size=2> cmd = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>new</FONT></FONT><FONT size=2> </FONT><FONT color=#008080 size=2><FONT color=#008080 size=2>HostFileCommand</FONT></FONT><FONT size=2>(</FONT><FONT color=#800000 size=2><FONT color=#800000 size=2>"EXEC 'SNDMSG MSG(HELLO) TOUSR(USERID)'"</FONT></FONT><FONT size=2>, cn);</P>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>string</FONT></FONT><FONT size=2> RESULT = (</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>string</FONT></FONT><FONT size=2>)cmd.ExecuteScalar();</P>
<P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// the result is dependednt upon the command getting executed. </P></FONT></FONT><FONT size=2>
<P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// if command is wrong , it will give syntax error and will not execute at all.</P></FONT></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>if</FONT></FONT><FONT size=2> (RESULT.Equals(</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>string</FONT></FONT><FONT size=2>.Empty))</P>
<P>{</P>
<P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// check for result to determine successfull execution of command.</P></FONT></FONT><FONT size=2>
<P>}</P></BLOCKQUOTE>
<P>}</P>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>catch</FONT></FONT><FONT size=2> (</FONT><FONT color=#008080 size=2><FONT color=#008080 size=2>Exception</FONT></FONT><FONT size=2> e)</P>
<P>{</P>
<P>}</P>
<BLOCKQUOTE>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>finally</P></FONT></FONT><FONT size=2>
<P>{</P>
<BLOCKQUOTE>
<P>cn.Close(); </P></BLOCKQUOTE>
<P>}</P></BLOCKQUOTE>
<BLOCKQUOTE>
<P>}</P></BLOCKQUOTE>
<P>}</P>
<P>}</P></FONT>]]></content:encoded>
    </item>
  </channel>
</rss>