<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5272785075638971360</id><updated>2026-09-11T13:08:17.970+05:30</updated><title type='text'>Dot Net</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dhavaldchauhan.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://dhavaldchauhan.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Dhaval Chauhan</name><uri>http://www.blogger.com/profile/09825343181598773305</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIy30CFXmSnfDgARcOeX5neh8pDl4zf1mlZBUFsolr8Ikyws1Xlvf-1n8mJAZIX8AngQE5IWG91OV1xc9mjvL-VXEhV6TuBleFg-w8UoRCihX8OOD_6q58jTPiCdSr/s220/MyPhoto.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>48</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5272785075638971360.post-2042375136638201713</id><published>2014-03-07T19:10:00.002+05:30</published><updated>2014-03-07T19:10:16.063+05:30</updated><title type='text'>ALTER User Defined Table Type without removing dependancy</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Use LotusBOS_Development&lt;br /&gt;
Go&lt;br /&gt;
If Object_Id(&#39;dbo.SPA_SystemUDTT_Update&#39;) Is Not Null&lt;br /&gt;
Begin&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Drop Proc dbo.SPA_SystemUDTT_Update&lt;br /&gt;
End&lt;br /&gt;
Go&lt;br /&gt;
/*&lt;br /&gt;
Created By : Dhaval Chauhan, Created On : 24 Feb 2014&lt;br /&gt;
Exec SPA_SystemUDTT_Update&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@ObjectName = &#39;TBLB_SupplierPLOFType&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@TableTypeScript = &#39;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;/****** Object: &amp;nbsp;UserDefinedTableType [dbo].[TBLB_SupplierPLOFType] &amp;nbsp; &amp;nbsp;Script Date: 3/7/2014 5:35:23 PM ******/&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;CREATE TYPE [dbo].[TBLB_SupplierPLOFType] AS TABLE(&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLItemType] [varchar](2) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLSalesType] [varchar](2) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLWeightType] [varchar](2) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLVATID] [tinyint] NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLID] [bigint] NOT NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuGrID] [smallint] NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuppID] [bigint] NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLProductCode] [varchar](25) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLEffectiveDate] [datetime] NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLEndDate] [datetime] NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLReason] [varchar](50) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLNSP] [decimal](20, 4) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLPromotionNSP] [decimal](20, 4) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLRSP] [decimal](20, 4) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLPromotionRSP] [decimal](20, 4) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLPalletNSP] [decimal](20, 4) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLPalletPromotionNSP] [decimal](20, 4) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLPromotionID] [int] NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLPromotionRetail] [decimal](20, 4) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLPromotionSellStartDate_Original] [datetime] NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLPromotionSellEndDate_Original] [datetime] NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLPromotionSellStartDate] [datetime] NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLPromotionSellEndDate] [datetime] NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLPromotionOrderStartDate] [datetime] NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLPromotionOrderEndDate] [datetime] NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLVATCode] [varchar](12) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLVATRate] [decimal](20, 10) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLPOR] [decimal](20, 2) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLCurrency] [varchar](6) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLDivisionRMS] [int] NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLCommodityGroup] [int] NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLSubCommodityGroup] [int] NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLsubSubCommodityGroup] [int] NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLcatchWeight] [bit] NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLPlof] [int] NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLOwnLabel] [varchar](1) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLInnerEAN] [varchar](18) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLOuterEAN] [varchar](18) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLshortDescription] [varchar](50) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLlongDescription] [varchar](100) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLnumberUnitsPack] [decimal](20, 4) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLunitWeight] [decimal](20, 2) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLisPresell] [varchar](1) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLPalletSize] [decimal](12, 4) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLpackageUOM] [varchar](4) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLWeight] [decimal](12, 4) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLunitPriceMeasure] [varchar](20) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLWidth] [decimal](20, 4) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLdepth] [decimal](20, 4) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLheight] [decimal](20, 4) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLlwhUnitOfMeasure] [varchar](20) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLnetWeight] [decimal](20, 4) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLmaxOrderQuantity] [decimal](20, 4) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLblackListed] [varchar](1) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLprePricedFlag] [varchar](1) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLlastSubstitute] [varchar](25) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLlastRatio] [decimal](20, 2) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLrangeStatus] [varchar](1) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLpackDesc] [varchar](20) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLforecast] [varchar](1) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLlabel] [varchar](8) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLpricingUnitOfMeasure] [varchar](40) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLplofShelfLife] [smallint] NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLPriceCheckIndPlus] [varchar](1) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLPriceCheckInd] [varchar](1) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLcoreRange] [varchar](1) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLcoreRangePlus] [bit] NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLsurchargeIncludeFlag] [bit] NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLsurchargeApplicableFlag] [bit] NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLrspFactor] [int] NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLcountryOfOriginID] [varchar](10) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLcountryOfOriginName] [varchar](100) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLrspOther] [varchar](1000) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLproductAttribute] [varchar](100) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuGDID] [smallint] NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[ProdID] [int] NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[ItGrID] [int] NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLPricingStrategyType] [char](1) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLPricingStrategyValue] [decimal](7, 2) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLRoundingType] [char](1) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLRoundingPoint1] [tinyint] NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLRoundingPoint2] [tinyint] NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SuPLRRP] [decimal](20, 4) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[SyReMessage] [varchar](1000) NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;[MyColumn] Varchar (10) NULL&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;)&#39;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;###&lt;br /&gt;
*/&lt;br /&gt;
Create PROCEDURE [dbo].[SPA_SystemUDTT_Update]&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@ObjectName Varchar(1000),&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@TableTypeScript Varchar(max)&lt;br /&gt;
AS&lt;br /&gt;
SET NOCOUNT ON&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;SET XACT_ABORT ON&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Declare @TransName Varchar(100) = NewId()&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
Begin Try&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Begin Transaction @TransName;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Declare @DependantSource As Table (RowId Bigint,[Object_Name] Varchar(1000),[Script] Varchar(max),[Type] Varchar(50))&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;If Object_Id(&#39;dbo.[SequenceSystemDependancy]&#39;) Is Not NUll&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Begin&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Drop SEQUENCE [DBO].[SequenceSystemDependancy]&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;End&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;CREATE SEQUENCE [DBO].[SequenceSystemDependancy] AS INT START WITH 1 INCREMENT BY 1&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Insert Into @DependantSource&lt;br /&gt;
&amp;nbsp; &amp;nbsp; SELECT NEXT VALUE FOR DBO.SequenceSystemDependancy, OBJECT_NAME(m.object_id) [Object_Name],m.Definition As Script,o.Type&lt;br /&gt;
&amp;nbsp; &amp;nbsp; FROM sys.sql_expression_dependencies d&lt;br /&gt;
&amp;nbsp; &amp;nbsp; JOIN sys.sql_modules m ON m.object_id = d.referencing_id&lt;br /&gt;
&amp;nbsp; &amp;nbsp; JOIN sys.objects o ON o.object_id = m.object_id&lt;br /&gt;
&amp;nbsp; &amp;nbsp; WHERE referenced_id = TYPE_ID(@ObjectName)&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;----///----------Alter Sequence to decending order -----------&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;---- =====================================================================================================================================&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Declare @sqlSequence As Varchar(max) = &#39;&#39;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Set @sqlSequence = &#39;Alter SEQUENCE [DBO].[SequenceSystemDependancy] RESTART WITH &#39;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;+ Cast(&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;(Select &amp;nbsp;Current_Value FROM SYS.Sequences WHERE name=&#39;SequenceSystemDependancy&#39;)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;As Varchar(10))+ &#39; INCREMENT BY -1 MINVALUE 0 MAXVALUE &#39;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;+ Cast(&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;(Select &amp;nbsp;Current_Value FROM SYS.Sequences WHERE name=&#39;SequenceSystemDependancy&#39;)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;As Varchar(10))&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;execute (@sqlSequence);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Declare @ObjectNameR Varchar(1000)= Null,@ObjectTypeR Varchar(50) = NULL&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;While (NEXT VALUE FOR DBO.SequenceSystemDependancy&amp;gt;0)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Begin&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Select @ObjectNameR = NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;@ObjectTypeR = NULL&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Select @ObjectTypeR = p.[Type],@ObjectNameR = p.[Object_Name]&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;From @DependantSource p&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Where p.RowId = cast((SELECT Current_Value FROM SYS.Sequences With(NoLock) WHERE name=&#39;SequenceSystemDependancy&#39;) As BigInt)&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;If Object_Id(@ObjectNameR) Is Not Null And @ObjectTypeR = &#39;P&#39;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Begin&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Execute (&#39;Drop Proc &#39;+@ObjectNameR);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;End&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;End&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;execute (&#39;Drop Type &#39;+@ObjectName);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;execute(@TableTypeScript);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Set @sqlSequence = &#39;Alter SEQUENCE [DBO].[SequenceSystemDependancy] RESTART WITH &#39;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;+ Cast(&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;(Select Count(1) From @DependantSource)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;As Varchar(10))+ &#39; INCREMENT BY -1 MINVALUE 0&#39;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;execute (@sqlSequence);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Declare @ObjectNameC As Varchar(1000) ,@ObjectTypeC Varchar(50) ,@ObjectScriptC Varchar(max)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;While (NEXT VALUE FOR DBO.SequenceSystemDependancy&amp;gt;0)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Begin&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Select @ObjectNameC = NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;@ObjectTypeC = NULL,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;@ObjectScriptC = NULL&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Select @ObjectTypeC = p.[Type],@ObjectNameC = p.[Object_Name],@ObjectScriptC = p.Script&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;From @DependantSource p&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Where p.RowId = cast((SELECT Current_Value FROM SYS.Sequences With(NoLock) WHERE name=&#39;SequenceSystemDependancy&#39;) As BigInt)&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;execute(@ObjectScriptC);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;End&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;-- =====================================================================================================================================&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;--///----------Remove Sequence If Any-----------&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;-- =====================================================================================================================================&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;If Object_Id(&#39;DBO.SequenceSystemDependancy&#39;) Is Not Null&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Begin&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Drop SEQUENCE [DBO].[SequenceSystemDependancy]&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;End&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
Commit Transaction @TransName&lt;br /&gt;
End Try&lt;br /&gt;
Begin Catch&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;IF (@@TRANCOUNT &amp;gt; 0 )&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;BEGIN&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;IF (XACT_STATE()) = -1&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;BEGIN&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;ROLLBACK TRANSACTION @TransName&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;END&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;END&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;EXEC [SPBE_LogAndThrowException] &#39;SPA_System_UpdateUDTT&#39;;&lt;br /&gt;
End Catch&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dhavaldchauhan.blogspot.com/feeds/2042375136638201713/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5272785075638971360/2042375136638201713?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/2042375136638201713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/2042375136638201713'/><link rel='alternate' type='text/html' href='http://dhavaldchauhan.blogspot.com/2014/03/alter-user-defined-table-type-without.html' title='ALTER User Defined Table Type without removing dependancy'/><author><name>Dhaval Chauhan</name><uri>http://www.blogger.com/profile/09825343181598773305</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIy30CFXmSnfDgARcOeX5neh8pDl4zf1mlZBUFsolr8Ikyws1Xlvf-1n8mJAZIX8AngQE5IWG91OV1xc9mjvL-VXEhV6TuBleFg-w8UoRCihX8OOD_6q58jTPiCdSr/s220/MyPhoto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5272785075638971360.post-3095401568767298819</id><published>2012-04-19T17:52:00.006+05:30</published><updated>2012-04-19T18:28:04.578+05:30</updated><title type='text'>Online XML Parsing in SQL</title><content type='html'>&lt;div&gt;&lt;pre class=&quot;lang-sql prettyprint&quot; style=&quot;border-style: initial; border-color: initial; border-image: initial; font-family: inherit; margin-top: 0px; margin-bottom: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 2px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-width: initial; list-style-type: none; word-wrap: normal; direction: ltr; border-top-color: rgb(136, 136, 136); border-right-color: rgb(136, 136, 136); border-bottom-color: rgb(136, 136, 136); border-left-color: rgb(136, 136, 136); overflow-y: hidden; overflow-x: auto; color: rgb(51, 51, 51); font-size: 14px; line-height: 17px; background-color: rgb(255, 255, 255); &quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;sp_configure &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 136, 0); &quot;&gt;&#39;Show Advanced Option&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;,&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 102, 102); &quot;&gt;1&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kwd&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 136); &quot;&gt;Reconfigure&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;go&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;sp_configure &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 136, 0); &quot;&gt;&#39;Ole Automation Procedures&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;,&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 102, 102); &quot;&gt;1&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kwd&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 136); &quot;&gt;Reconfigure&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;  go  &lt;/span&gt;&lt;br /&gt;&lt;p style=&quot;border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; list-style-type: none; &quot;&gt;&lt;/p&gt;&lt;p style=&quot;border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; list-style-type: none; &quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 136); &quot;&gt;Declare&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;@&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;Object &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 136); &quot;&gt;as&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; Int&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;      &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; list-style-type: none; &quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 136); &quot;&gt;Declare&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;@&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;ResponseText1 &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 136); &quot;&gt;as&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; Varchar&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 102, 102); &quot;&gt;8000&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;      &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; list-style-type: none; &quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 136); &quot;&gt;Declare&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;@&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;Url &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 136); &quot;&gt;as&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; Varchar&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;MAX&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;     &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; list-style-type: none; &quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 136); &quot;&gt;select&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;@&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;Url &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 136, 0); &quot;&gt;&#39;http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml&#39;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;     &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; list-style-type: none; &quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;  &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 136); &quot;&gt;Exec&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; sp_OACreate &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 136, 0); &quot;&gt;&#39;MSXML2.XMLHTTP&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;@&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;Object OUT&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;     &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; list-style-type: none; &quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 136); &quot;&gt;Exec&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; sp_OAMethod &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;@&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;Object&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 136, 0); &quot;&gt;&#39;open&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 136); &quot;&gt;NULL&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 136, 0); &quot;&gt;&#39;get&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;@&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;Url&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 136, 0); &quot;&gt;&#39;false&#39;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;      &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; list-style-type: none; &quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 136); &quot;&gt;Exec&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; sp_OAMethod &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;@&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;Object&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 136, 0); &quot;&gt;&#39;send&#39;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;      &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; list-style-type: none; &quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 136); &quot;&gt;Exec&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; sp_OAMethod &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;@&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;Object&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 136, 0); &quot;&gt;&#39;responseText&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;@&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;ResponseText1 OUTPUT          &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; list-style-type: none; &quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 136); &quot;&gt;Exec&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; sp_OADestroy &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;@&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;Object       &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(136, 0, 0); &quot;&gt;--load into Xml &lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;    &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; list-style-type: none; &quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 136); &quot;&gt;Declare&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;@&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;XmlResponse &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 136); &quot;&gt;as&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; xml&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;         &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; list-style-type: none; &quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;  &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 136); &quot;&gt;select&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;@&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;XmlResponse &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; CAST&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;(@&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;ResponseText1 &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 136); &quot;&gt;as&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; xml&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;         &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; list-style-type: none; &quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;;&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 136); &quot;&gt;with&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; xmlnamespaces &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;   &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 136, 0); &quot;&gt;&#39;http://www.ecb.int/vocabulary/2002-08-01/eurofxref&#39;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 136); &quot;&gt;as&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; Envelope&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; list-style-type: none; &quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 136, 0); &quot;&gt;&#39;http://www.gesmes.org/xml/2002-08-01&#39;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 136); &quot;&gt;as&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; gesmes &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;)&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; list-style-type: none; &quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 136); &quot;&gt;select&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; x&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;i&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;value&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 136, 0); &quot;&gt;&#39;@rate&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;,&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 136, 0); &quot;&gt;&#39;money&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;[&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;Money&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;],&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;x&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;i&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;value&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 136, 0); &quot;&gt;&#39;@currency&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;,&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 136, 0); &quot;&gt;&#39;char(3)&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 136); &quot;&gt;As&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;[&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;Currency&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;]&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;  &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; list-style-type: none; &quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 136); &quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;@&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;XmlResponse&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;nodes&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 136, 0); &quot;&gt;&#39;/gesmes:Envelope/Envelope:Cube/Envelope:Cube/Envelope:Cube&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;  &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 136); &quot;&gt;as&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt; x&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 0); &quot;&gt;i&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 0); &quot;&gt;)&lt;/span&gt;&lt;/p&gt;&lt;/pre&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhavaldchauhan.blogspot.com/feeds/3095401568767298819/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5272785075638971360/3095401568767298819?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/3095401568767298819'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/3095401568767298819'/><link rel='alternate' type='text/html' href='http://dhavaldchauhan.blogspot.com/2012/04/online-xml-parsing-in-sql.html' title='Online XML Parsing in SQL'/><author><name>Dhaval Chauhan</name><uri>http://www.blogger.com/profile/09825343181598773305</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIy30CFXmSnfDgARcOeX5neh8pDl4zf1mlZBUFsolr8Ikyws1Xlvf-1n8mJAZIX8AngQE5IWG91OV1xc9mjvL-VXEhV6TuBleFg-w8UoRCihX8OOD_6q58jTPiCdSr/s220/MyPhoto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5272785075638971360.post-4549048711465640955</id><published>2012-04-18T16:22:00.004+05:30</published><updated>2012-04-19T12:56:04.810+05:30</updated><title type='text'>XML Deserialization and Seriallization in C#</title><content type='html'>&lt;div style=&quot;font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; &quot;&gt;&lt;span&gt; public  class XMLData&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; &quot;&gt;&lt;span&gt;        {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; &quot;&gt;&lt;span&gt;            public string Data1 { get; set; }&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; &quot;&gt;&lt;span&gt;            public string Data2 { get; set; }&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; &quot;&gt;&lt;span&gt;        }&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; &quot;&gt;&lt;span&gt;        private void Deserialize()&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; &quot;&gt;&lt;span&gt;        {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; &quot;&gt;&lt;span&gt;            try&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; &quot;&gt;&lt;span&gt;            {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; &quot;&gt;&lt;span&gt;                string strXML = string.Empty;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; &quot;&gt;&lt;span&gt;                strXML = &quot;&lt;roots&gt;&lt;xmldata&gt;&lt;data1&gt;a&lt;/data1&gt;&lt;data2&gt;a&lt;/data2&gt;&lt;/xmldata&gt;&lt;xmldata&gt;&lt;data1&gt;b&lt;/data1&gt;&lt;data2&gt;c&lt;/data2&gt;&lt;/xmldata&gt;&lt;/roots&gt;&quot;;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; &quot;&gt;&lt;span&gt;                string strTemp = &quot;&lt;!--?xml version=&#39;1.0&#39; encoding=&#39;utf-8&#39;?--&gt;&quot; + strXML;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; &quot;&gt;&lt;span&gt;                XmlRootAttribute rt = new XmlRootAttribute(&quot;Roots&quot;);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; &quot;&gt;&lt;span&gt;                XmlSerializer serializer = new XmlSerializer(typeof(XMLData[]), rt);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; &quot;&gt;&lt;span&gt;                XMLData[] xmlDatas = null;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; &quot;&gt;&lt;span&gt;                byte[] bt = Encoding.UTF8.GetBytes(strTemp);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; &quot;&gt;&lt;span&gt;                MemoryStream ms = new MemoryStream(bt);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; &quot;&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; &quot;&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; &quot;&gt;&lt;span&gt;                xmlDatas = (XMLData[])serializer.Deserialize(ms);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; &quot;&gt;&lt;span&gt;            }&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; &quot;&gt;&lt;span&gt;            catch (Exception ex)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; &quot;&gt;&lt;span&gt;            { &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; &quot;&gt;&lt;span&gt;            }&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; &quot;&gt;&lt;span&gt;            &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; &quot;&gt;&lt;span&gt;        }&lt;blockquote&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;div&gt; private void Serialize(XMLData[] xmlDatas)&lt;/div&gt;&lt;div&gt;        {&lt;/div&gt;&lt;div&gt;            try&lt;/div&gt;&lt;div&gt;            {&lt;/div&gt;&lt;div&gt;                XmlSerializer serializer = new XmlSerializer(typeof(XMLData[]));&lt;/div&gt;&lt;div&gt;                StringBuilder stringBuilder = new StringBuilder();&lt;/div&gt;&lt;div&gt;                System.Xml.XmlWriterSettings xWriSetting = new System.Xml.XmlWriterSettings();&lt;/div&gt;&lt;div&gt;                xWriSetting.Encoding = Encoding.UTF8;&lt;/div&gt;&lt;div&gt;                xWriSetting.ConformanceLevel = System.Xml.ConformanceLevel.Document;&lt;/div&gt;&lt;div&gt;                xWriSetting.CheckCharacters = false;&lt;/div&gt;&lt;div&gt;                xWriSetting.Indent = false;&lt;/div&gt;&lt;div&gt;                xWriSetting.OmitXmlDeclaration = true;&lt;/div&gt;&lt;div&gt;                xWriSetting.CloseOutput = false;&lt;/div&gt;&lt;div&gt;                &lt;/div&gt;&lt;div&gt;                &lt;/div&gt;&lt;div&gt;                System.Xml.XmlWriter xmlWriter = System.Xml.XmlWriter.Create(stringBuilder, xWriSetting);&lt;/div&gt;&lt;div&gt;                &lt;/div&gt;&lt;div&gt;                serializer.Serialize(xmlWriter, xmlDatas);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;                string strOp = stringBuilder.ToString();&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;            }&lt;/div&gt;&lt;div&gt;            catch (Exception ex)&lt;/div&gt;&lt;div&gt;            {&lt;/div&gt;&lt;div&gt;            }&lt;/div&gt;&lt;div&gt;        }&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhavaldchauhan.blogspot.com/feeds/4549048711465640955/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5272785075638971360/4549048711465640955?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/4549048711465640955'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/4549048711465640955'/><link rel='alternate' type='text/html' href='http://dhavaldchauhan.blogspot.com/2012/04/xml-deserialization-in-c.html' title='XML Deserialization and Seriallization in C#'/><author><name>Dhaval Chauhan</name><uri>http://www.blogger.com/profile/09825343181598773305</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIy30CFXmSnfDgARcOeX5neh8pDl4zf1mlZBUFsolr8Ikyws1Xlvf-1n8mJAZIX8AngQE5IWG91OV1xc9mjvL-VXEhV6TuBleFg-w8UoRCihX8OOD_6q58jTPiCdSr/s220/MyPhoto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5272785075638971360.post-646268254095768026</id><published>2012-03-27T14:34:00.001+05:30</published><updated>2012-03-27T14:35:19.501+05:30</updated><title type='text'>Recursive Common Table Expression</title><content type='html'>DECLARE @Date DATE = &#39;1900-01-01&#39;,&lt;br /&gt;  @inc INT = 0&lt;br /&gt;&lt;br /&gt;;with cte as&lt;br /&gt;(&lt;br /&gt; select @inc AS Inc,DATENAME(mm,@Date) AS [MonthName],DATEPART(mm,@Date) AS [MonthNumber]&lt;br /&gt; UNION ALL&lt;br /&gt; select inc+1,DATENAME(mm,DATEADD(mm,inc+1,@Date)),DATEPART(mm,DATEADD(mm,inc+1,@Date))&lt;br /&gt; FROM cte&lt;br /&gt; where inc &amp;lt; 11&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;select [MonthName],[MonthNumber] from cte</content><link rel='replies' type='application/atom+xml' href='http://dhavaldchauhan.blogspot.com/feeds/646268254095768026/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5272785075638971360/646268254095768026?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/646268254095768026'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/646268254095768026'/><link rel='alternate' type='text/html' href='http://dhavaldchauhan.blogspot.com/2012/03/recursive-common-table-expression.html' title='Recursive Common Table Expression'/><author><name>Dhaval Chauhan</name><uri>http://www.blogger.com/profile/09825343181598773305</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIy30CFXmSnfDgARcOeX5neh8pDl4zf1mlZBUFsolr8Ikyws1Xlvf-1n8mJAZIX8AngQE5IWG91OV1xc9mjvL-VXEhV6TuBleFg-w8UoRCihX8OOD_6q58jTPiCdSr/s220/MyPhoto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5272785075638971360.post-2134314438256565417</id><published>2012-03-14T19:35:00.002+05:30</published><updated>2012-03-14T19:35:43.856+05:30</updated><title type='text'>XML File to SQL Table</title><content type='html'>DECLARE @FileName varchar(255)&lt;br /&gt;DECLARE @ExecCmd VARCHAR(255)&lt;br /&gt;DECLARE @y INT&lt;br /&gt;DECLARE @x INT&lt;br /&gt;DECLARE @FileContents VARCHAR(max)&lt;br /&gt;&lt;br /&gt;CREATE TABLE #tempXML(PK INT NOT NULL IDENTITY(1,1), ThisLine VARCHAR(255))&lt;br /&gt;&lt;br /&gt;SET @FileName = &#39;D:\MyShopData\MobileOperatorIdentify.xml&#39;&lt;br /&gt;SET @ExecCmd = &#39;type &#39; + @FileName&lt;br /&gt;SET @FileContents = &#39;&#39;&lt;br /&gt;&lt;br /&gt;INSERT INTO #tempXML EXEC master.dbo.xp_cmdshell @ExecCmd&lt;br /&gt;SELECT @y = count(*) from #tempXML&lt;br /&gt;&lt;br /&gt;SET @x = 0&lt;br /&gt;WHILE @x &lt;&gt; @y&lt;br /&gt;    BEGIN&lt;br /&gt;        SET @x = @x + 1&lt;br /&gt;        SELECT @FileContents = @FileContents + ThisLine from #tempXML WHERE PK&lt;br /&gt; = @x&lt;br /&gt;    END&lt;br /&gt;&lt;br /&gt;SELECT @FileContents as FileContents&lt;br /&gt;DROP TABLE #tempXML&lt;br /&gt;print @FileContents&lt;br /&gt;DECLARE @iDoc INT&lt;br /&gt;    EXEC sp_xml_preparedocument @iDoc OUTPUT, @FileContents&lt;br /&gt;&lt;br /&gt;SELECT PrefixId, OperatorId, PrefixNumber&lt;br /&gt;    FROM OPENXML(@iDoc,&#39;/DocumentElement/dtMobileOperatorPrefix&#39;,2)&lt;br /&gt;    With(&lt;br /&gt;  PrefixId varchar(10) &#39;PrefixId&#39;,&lt;br /&gt;  OperatorId varchar(10) &#39;OperatorId&#39;,&lt;br /&gt;  PrefixNumber varchar(10) &#39;PrefixNumber&#39;&lt;br /&gt;  )</content><link rel='replies' type='application/atom+xml' href='http://dhavaldchauhan.blogspot.com/feeds/2134314438256565417/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5272785075638971360/2134314438256565417?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/2134314438256565417'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/2134314438256565417'/><link rel='alternate' type='text/html' href='http://dhavaldchauhan.blogspot.com/2012/03/xml-file-to-sql-table.html' title='XML File to SQL Table'/><author><name>Dhaval Chauhan</name><uri>http://www.blogger.com/profile/09825343181598773305</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIy30CFXmSnfDgARcOeX5neh8pDl4zf1mlZBUFsolr8Ikyws1Xlvf-1n8mJAZIX8AngQE5IWG91OV1xc9mjvL-VXEhV6TuBleFg-w8UoRCihX8OOD_6q58jTPiCdSr/s220/MyPhoto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5272785075638971360.post-6793164450294660591</id><published>2012-03-05T19:31:00.003+05:30</published><updated>2012-03-05T19:36:40.075+05:30</updated><title type='text'>xml in a tabular format in sqlserver 2008</title><content type='html'>declare @xml xml&lt;br /&gt;set @xml =&#39;&lt;CampaignItems&gt;&lt;br /&gt;    --&lt;Record&gt;&lt;br /&gt;      -- &lt;EA&gt;abc@gmail.com&lt;/EA&gt; &lt;br /&gt;     --  &lt;CAS&gt;&lt;br /&gt;   --&lt;Attr Name=&quot;abc&quot; value=&quot;123&quot;&gt;&lt;/Attr&gt;&lt;br /&gt;  -- &lt;Attr Name=&quot;def&quot; value=&quot;345&quot;&gt;&lt;/Attr&gt;&lt;br /&gt; -- &lt;/CAS&gt; &lt;br /&gt;-- &lt;/Record&gt;&lt;br /&gt;-- &lt;Record&gt;&lt;br /&gt;       --&lt;EA&gt;def@gmail.com&lt;/EA&gt; &lt;br /&gt;     --  &lt;CAS&gt;&lt;br /&gt; -- &lt;Attr Name=&quot;abc&quot; value=&quot;123&quot;&gt;&lt;/Attr&gt;&lt;br /&gt; -- &lt;Attr Name=&quot;def&quot; value=&quot;345&quot;&gt;&lt;/Attr&gt;&lt;br /&gt; --   &lt;/CAS&gt;&lt;br /&gt;--&lt;/Record&gt;&lt;br /&gt;--&lt;/CampaignItems&gt;&#39;&lt;br /&gt;/*-----------------------------------------------------&lt;br /&gt;  abc@gmail.com   abc                     123&lt;br /&gt;  abc@gmail.com   def                     345&lt;br /&gt;  def@gmail.com   abc                     123&lt;br /&gt;  def@gmail.com   def                     345&lt;br /&gt;  */&lt;br /&gt;  &lt;br /&gt;  &lt;br /&gt;  SELECT &lt;br /&gt;x.v.value(&#39;../../EA[1]&#39;,&#39;varchar(100)&#39;) as EMail,&lt;br /&gt;x.v.value(&#39;@Name[1]&#39;,&#39;varchar(1000)&#39;) as CAS,&lt;br /&gt;x.v.value(&#39;@value[1]&#39;,&#39;varchar(1000)&#39;) as Value&lt;br /&gt;&lt;br /&gt;FROM @xml.nodes(&#39;CampaignItems/Record/CAS/Attr&#39;) x(v)</content><link rel='replies' type='application/atom+xml' href='http://dhavaldchauhan.blogspot.com/feeds/6793164450294660591/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5272785075638971360/6793164450294660591?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/6793164450294660591'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/6793164450294660591'/><link rel='alternate' type='text/html' href='http://dhavaldchauhan.blogspot.com/2012/03/xml-in-tabular-format-in-sqlserver-2008.html' title='xml in a tabular format in sqlserver 2008'/><author><name>Dhaval Chauhan</name><uri>http://www.blogger.com/profile/09825343181598773305</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIy30CFXmSnfDgARcOeX5neh8pDl4zf1mlZBUFsolr8Ikyws1Xlvf-1n8mJAZIX8AngQE5IWG91OV1xc9mjvL-VXEhV6TuBleFg-w8UoRCihX8OOD_6q58jTPiCdSr/s220/MyPhoto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5272785075638971360.post-907416405997202949</id><published>2012-02-22T12:23:00.001+05:30</published><updated>2012-02-22T12:38:15.956+05:30</updated><title type='text'>SQL-Server Query from your SQL-Server</title><content type='html'>Note :&lt;br /&gt; To execute other SQL-Server SQL Query from your SQL-Server&lt;br /&gt; &lt;br /&gt; To Enable This Option Follow Step 1 and 2&lt;br /&gt;&lt;br /&gt;#####Step 1&lt;br /&gt;&lt;br /&gt;sp_configure &#39;show advanced options&#39;, 1;&lt;br /&gt;RECONFIGURE;&lt;br /&gt;&lt;br /&gt;#####Step 2&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;sp_configure &#39;Ad Hoc Distributed Queries&#39;, 1;&lt;br /&gt;RECONFIGURE;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#####Step 3 - Execute Your Query &lt;br /&gt;SELECT top 10 * &lt;br /&gt;FROM OPENROWSET(&#39;SQLNCLI&#39;,&#39;Server=DbServerName;Uid=username;Pwd=password;Database=databasename;&#39;,&lt;br /&gt; &#39;SELECT * FROM tabelname&#39;) AS FS&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;sp_configure &#39;show advanced options&#39;, 1;&lt;br /&gt;RECONFIGURE;&lt;br /&gt;sp_configure &#39;Ad Hoc Distributed Queries&#39;, 1;&lt;br /&gt;RECONFIGURE;</content><link rel='replies' type='application/atom+xml' href='http://dhavaldchauhan.blogspot.com/feeds/907416405997202949/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5272785075638971360/907416405997202949?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/907416405997202949'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/907416405997202949'/><link rel='alternate' type='text/html' href='http://dhavaldchauhan.blogspot.com/2012/02/sql-server-query-from-your-sql-server.html' title='SQL-Server Query from your SQL-Server'/><author><name>Dhaval Chauhan</name><uri>http://www.blogger.com/profile/09825343181598773305</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIy30CFXmSnfDgARcOeX5neh8pDl4zf1mlZBUFsolr8Ikyws1Xlvf-1n8mJAZIX8AngQE5IWG91OV1xc9mjvL-VXEhV6TuBleFg-w8UoRCihX8OOD_6q58jTPiCdSr/s220/MyPhoto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5272785075638971360.post-515824318460359373</id><published>2012-01-06T12:02:00.005+05:30</published><updated>2012-01-06T12:18:37.586+05:30</updated><title type='text'>How to use c# class in VB.net Web application</title><content type='html'>Step 1 : Add App_Code Folder in ROOT directory&lt;br /&gt;&lt;br /&gt;Step 2 : Add Two folder n App_Code Folder name as &quot;cscode&quot;, &quot;vbcode&quot;&lt;br /&gt;&lt;br /&gt;Step 3 : Now open web config file.&lt;br /&gt; Add Follwing section in compilation section&lt;br /&gt; &lt;br /&gt;How to use c# class in VB.net Web application&lt;br /&gt;&lt;br /&gt;Step 1 : Add App_Code Folder in ROOT directory&lt;br /&gt;&lt;br /&gt;Step 2 : Add Two folder n App_Code Folder name as &quot;cscode&quot;, &quot;vbcode&quot;&lt;br /&gt;&lt;br /&gt;Step 3 : Now open web config file.&lt;br /&gt; Add Follwing section in compilation section&lt;br /&gt; &lt;br /&gt; codeSubDirectories&gt;&lt;br /&gt; add directoryName=&quot;vbcode&quot;/&gt;&lt;br /&gt;   add directoryName=&quot;cscode&quot;/&gt;&lt;br /&gt;codeSubDirectories&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhavaldchauhan.blogspot.com/feeds/515824318460359373/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5272785075638971360/515824318460359373?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/515824318460359373'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/515824318460359373'/><link rel='alternate' type='text/html' href='http://dhavaldchauhan.blogspot.com/2012/01/how-to-use-c-class-in-vbnet-web.html' title='How to use c# class in VB.net Web application'/><author><name>Dhaval Chauhan</name><uri>http://www.blogger.com/profile/09825343181598773305</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIy30CFXmSnfDgARcOeX5neh8pDl4zf1mlZBUFsolr8Ikyws1Xlvf-1n8mJAZIX8AngQE5IWG91OV1xc9mjvL-VXEhV6TuBleFg-w8UoRCihX8OOD_6q58jTPiCdSr/s220/MyPhoto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5272785075638971360.post-5338896585739425412</id><published>2011-12-12T19:32:00.002+05:30</published><updated>2011-12-12T19:32:40.469+05:30</updated><title type='text'>Datatable XML to SQL Table Conversion</title><content type='html'>Declare @VarXML As XML&lt;br /&gt;Set @VarXML = &#39;&lt;DocumentElement&gt;&lt;br /&gt;  &lt;DailyWorkReport&gt;&lt;br /&gt;    &lt;Type&gt;Planned&lt;/Type&gt;&lt;br /&gt;    &lt;ProjectNo&gt;6&lt;/ProjectNo&gt;&lt;br /&gt;    &lt;Value&gt;0&lt;/Value&gt;&lt;br /&gt;  &lt;/DailyWorkReport&gt;&lt;br /&gt;  &lt;DailyWorkReport&gt;&lt;br /&gt;    &lt;Type&gt;Planned&lt;/Type&gt;&lt;br /&gt;    &lt;ProjectNo&gt;7&lt;/ProjectNo&gt;&lt;br /&gt;    &lt;Value&gt;0&lt;/Value&gt;&lt;br /&gt;  &lt;/DailyWorkReport&gt;&lt;br /&gt;  &lt;DailyWorkReport&gt;&lt;br /&gt;    &lt;Type&gt;Planned&lt;/Type&gt;&lt;br /&gt;    &lt;ProjectNo&gt;8&lt;/ProjectNo&gt;&lt;br /&gt;    &lt;Value&gt;0&lt;/Value&gt;&lt;br /&gt;  &lt;/DailyWorkReport&gt;&lt;br /&gt;  &lt;DailyWorkReport&gt;&lt;br /&gt;    &lt;Type&gt;Planned&lt;/Type&gt;&lt;br /&gt;    &lt;ProjectNo&gt;10&lt;/ProjectNo&gt;&lt;br /&gt;    &lt;Value&gt;0&lt;/Value&gt;&lt;br /&gt;  &lt;/DailyWorkReport&gt;&lt;br /&gt;  &lt;DailyWorkReport&gt;&lt;br /&gt;    &lt;Type&gt;Planned&lt;/Type&gt;&lt;br /&gt;    &lt;ProjectNo&gt;11&lt;/ProjectNo&gt;&lt;br /&gt;    &lt;Value&gt;0&lt;/Value&gt;&lt;br /&gt;  &lt;/DailyWorkReport&gt;&lt;br /&gt;  &lt;DailyWorkReport&gt;&lt;br /&gt;    &lt;Type&gt;Planned&lt;/Type&gt;&lt;br /&gt;    &lt;ProjectNo&gt;13&lt;/ProjectNo&gt;&lt;br /&gt;    &lt;Value&gt;0&lt;/Value&gt;&lt;br /&gt;  &lt;/DailyWorkReport&gt;&lt;br /&gt;  &lt;DailyWorkReport&gt;&lt;br /&gt;    &lt;Type&gt;Planned&lt;/Type&gt;&lt;br /&gt;    &lt;ProjectNo&gt;15&lt;/ProjectNo&gt;&lt;br /&gt;    &lt;Value&gt;0&lt;/Value&gt;&lt;br /&gt;  &lt;/DailyWorkReport&gt;&lt;br /&gt;  &lt;DailyWorkReport&gt;&lt;br /&gt;    &lt;Type&gt;Planned&lt;/Type&gt;&lt;br /&gt;    &lt;ProjectNo&gt;16&lt;/ProjectNo&gt;&lt;br /&gt;    &lt;Value&gt;0&lt;/Value&gt;&lt;br /&gt;  &lt;/DailyWorkReport&gt;&lt;br /&gt;  &lt;DailyWorkReport&gt;&lt;br /&gt;    &lt;Type&gt;Planned&lt;/Type&gt;&lt;br /&gt;    &lt;ProjectNo&gt;17&lt;/ProjectNo&gt;&lt;br /&gt;    &lt;Value&gt;0&lt;/Value&gt;&lt;br /&gt;  &lt;/DailyWorkReport&gt;&lt;br /&gt;  &lt;DailyWorkReport&gt;&lt;br /&gt;    &lt;Type&gt;Planned&lt;/Type&gt;&lt;br /&gt;    &lt;ProjectNo&gt;18&lt;/ProjectNo&gt;&lt;br /&gt;    &lt;Value&gt;0&lt;/Value&gt;&lt;br /&gt;  &lt;/DailyWorkReport&gt;&lt;br /&gt;  &lt;DailyWorkReport&gt;&lt;br /&gt;    &lt;Type&gt;Planned&lt;/Type&gt;&lt;br /&gt;    &lt;ProjectNo&gt;19&lt;/ProjectNo&gt;&lt;br /&gt;    &lt;Value&gt;0&lt;/Value&gt;&lt;br /&gt;  &lt;/DailyWorkReport&gt;&lt;br /&gt;  &lt;DailyWorkReport&gt;&lt;br /&gt;    &lt;Type&gt;Planned&lt;/Type&gt;&lt;br /&gt;    &lt;ProjectNo&gt;20&lt;/ProjectNo&gt;&lt;br /&gt;    &lt;Value&gt;0&lt;/Value&gt;&lt;br /&gt;  &lt;/DailyWorkReport&gt;&lt;br /&gt;  &lt;DailyWorkReport&gt;&lt;br /&gt;    &lt;Type&gt;Planned&lt;/Type&gt;&lt;br /&gt;    &lt;ProjectNo&gt;22&lt;/ProjectNo&gt;&lt;br /&gt;    &lt;Value&gt;0&lt;/Value&gt;&lt;br /&gt;  &lt;/DailyWorkReport&gt;&lt;br /&gt;  &lt;DailyWorkReport&gt;&lt;br /&gt;    &lt;Type&gt;Planned&lt;/Type&gt;&lt;br /&gt;    &lt;ProjectNo&gt;666&lt;/ProjectNo&gt;&lt;br /&gt;    &lt;Value&gt;0&lt;/Value&gt;&lt;br /&gt;  &lt;/DailyWorkReport&gt;&lt;br /&gt;  &lt;DailyWorkReport&gt;&lt;br /&gt;    &lt;Type&gt;Planned&lt;/Type&gt;&lt;br /&gt;    &lt;ProjectNo&gt;999&lt;/ProjectNo&gt;&lt;br /&gt;    &lt;Value&gt;0&lt;/Value&gt;&lt;br /&gt;  &lt;/DailyWorkReport&gt;&lt;br /&gt;  &lt;DailyWorkReport&gt;&lt;br /&gt;    &lt;Type&gt;Planned&lt;/Type&gt;&lt;br /&gt;    &lt;ProjectNo&gt;Comment&lt;/ProjectNo&gt;&lt;br /&gt;    &lt;Value /&gt;&lt;br /&gt;  &lt;/DailyWorkReport&gt;&lt;br /&gt;  &lt;DailyWorkReport&gt;&lt;br /&gt;    &lt;Type&gt;Actual&lt;/Type&gt;&lt;br /&gt;    &lt;ProjectNo&gt;6&lt;/ProjectNo&gt;&lt;br /&gt;    &lt;Value&gt;0&lt;/Value&gt;&lt;br /&gt;  &lt;/DailyWorkReport&gt;&lt;br /&gt;  &lt;DailyWorkReport&gt;&lt;br /&gt;    &lt;Type&gt;Actual&lt;/Type&gt;&lt;br /&gt;    &lt;ProjectNo&gt;7&lt;/ProjectNo&gt;&lt;br /&gt;    &lt;Value&gt;0&lt;/Value&gt;&lt;br /&gt;  &lt;/DailyWorkReport&gt;&lt;br /&gt;  &lt;DailyWorkReport&gt;&lt;br /&gt;    &lt;Type&gt;Actual&lt;/Type&gt;&lt;br /&gt;    &lt;ProjectNo&gt;8&lt;/ProjectNo&gt;&lt;br /&gt;    &lt;Value&gt;0&lt;/Value&gt;&lt;br /&gt;  &lt;/DailyWorkReport&gt;&lt;br /&gt;  &lt;DailyWorkReport&gt;&lt;br /&gt;    &lt;Type&gt;Actual&lt;/Type&gt;&lt;br /&gt;    &lt;ProjectNo&gt;10&lt;/ProjectNo&gt;&lt;br /&gt;    &lt;Value&gt;0&lt;/Value&gt;&lt;br /&gt;  &lt;/DailyWorkReport&gt;&lt;br /&gt;  &lt;DailyWorkReport&gt;&lt;br /&gt;    &lt;Type&gt;Actual&lt;/Type&gt;&lt;br /&gt;    &lt;ProjectNo&gt;11&lt;/ProjectNo&gt;&lt;br /&gt;    &lt;Value&gt;0&lt;/Value&gt;&lt;br /&gt;  &lt;/DailyWorkReport&gt;&lt;br /&gt;  &lt;DailyWorkReport&gt;&lt;br /&gt;    &lt;Type&gt;Actual&lt;/Type&gt;&lt;br /&gt;    &lt;ProjectNo&gt;13&lt;/ProjectNo&gt;&lt;br /&gt;    &lt;Value&gt;0&lt;/Value&gt;&lt;br /&gt;  &lt;/DailyWorkReport&gt;&lt;br /&gt;  &lt;DailyWorkReport&gt;&lt;br /&gt;    &lt;Type&gt;Actual&lt;/Type&gt;&lt;br /&gt;    &lt;ProjectNo&gt;15&lt;/ProjectNo&gt;&lt;br /&gt;    &lt;Value&gt;0&lt;/Value&gt;&lt;br /&gt;  &lt;/DailyWorkReport&gt;&lt;br /&gt;  &lt;DailyWorkReport&gt;&lt;br /&gt;    &lt;Type&gt;Actual&lt;/Type&gt;&lt;br /&gt;    &lt;ProjectNo&gt;16&lt;/ProjectNo&gt;&lt;br /&gt;    &lt;Value&gt;0&lt;/Value&gt;&lt;br /&gt;  &lt;/DailyWorkReport&gt;&lt;br /&gt;  &lt;DailyWorkReport&gt;&lt;br /&gt;    &lt;Type&gt;Actual&lt;/Type&gt;&lt;br /&gt;    &lt;ProjectNo&gt;17&lt;/ProjectNo&gt;&lt;br /&gt;    &lt;Value&gt;0&lt;/Value&gt;&lt;br /&gt;  &lt;/DailyWorkReport&gt;&lt;br /&gt;  &lt;DailyWorkReport&gt;&lt;br /&gt;    &lt;Type&gt;Actual&lt;/Type&gt;&lt;br /&gt;    &lt;ProjectNo&gt;18&lt;/ProjectNo&gt;&lt;br /&gt;    &lt;Value&gt;0&lt;/Value&gt;&lt;br /&gt;  &lt;/DailyWorkReport&gt;&lt;br /&gt;  &lt;DailyWorkReport&gt;&lt;br /&gt;    &lt;Type&gt;Actual&lt;/Type&gt;&lt;br /&gt;    &lt;ProjectNo&gt;19&lt;/ProjectNo&gt;&lt;br /&gt;    &lt;Value&gt;0&lt;/Value&gt;&lt;br /&gt;  &lt;/DailyWorkReport&gt;&lt;br /&gt;  &lt;DailyWorkReport&gt;&lt;br /&gt;    &lt;Type&gt;Actual&lt;/Type&gt;&lt;br /&gt;    &lt;ProjectNo&gt;20&lt;/ProjectNo&gt;&lt;br /&gt;    &lt;Value&gt;0&lt;/Value&gt;&lt;br /&gt;  &lt;/DailyWorkReport&gt;&lt;br /&gt;  &lt;DailyWorkReport&gt;&lt;br /&gt;    &lt;Type&gt;Actual&lt;/Type&gt;&lt;br /&gt;    &lt;ProjectNo&gt;22&lt;/ProjectNo&gt;&lt;br /&gt;    &lt;Value&gt;0&lt;/Value&gt;&lt;br /&gt;  &lt;/DailyWorkReport&gt;&lt;br /&gt;  &lt;DailyWorkReport&gt;&lt;br /&gt;    &lt;Type&gt;Actual&lt;/Type&gt;&lt;br /&gt;    &lt;ProjectNo&gt;666&lt;/ProjectNo&gt;&lt;br /&gt;    &lt;Value&gt;0&lt;/Value&gt;&lt;br /&gt;  &lt;/DailyWorkReport&gt;&lt;br /&gt;  &lt;DailyWorkReport&gt;&lt;br /&gt;    &lt;Type&gt;Actual&lt;/Type&gt;&lt;br /&gt;    &lt;ProjectNo&gt;999&lt;/ProjectNo&gt;&lt;br /&gt;    &lt;Value&gt;0&lt;/Value&gt;&lt;br /&gt;  &lt;/DailyWorkReport&gt;&lt;br /&gt;  &lt;DailyWorkReport&gt;&lt;br /&gt;    &lt;Type&gt;Actual&lt;/Type&gt;&lt;br /&gt;    &lt;ProjectNo&gt;Comment&lt;/ProjectNo&gt;&lt;br /&gt;    &lt;Value /&gt;&lt;br /&gt;  &lt;/DailyWorkReport&gt;&lt;br /&gt;&lt;/DocumentElement&gt;&#39;&lt;br /&gt;&lt;br /&gt;SELECT &lt;br /&gt; x.v.value(&#39;Type[1]&#39;,&#39;varchar(10)&#39;) as type,&lt;br /&gt; x.v.value(&#39;ProjectNo[1]&#39;,&#39;varchar(10)&#39;) as ProjectNo,&lt;br /&gt; x.v.value(&#39;Value[1]&#39;,&#39;varchar(max)&#39;) As Value&lt;br /&gt;FROM   @VarXML.nodes(&#39;DocumentElement/DailyWorkReport&#39;) x(v)</content><link rel='replies' type='application/atom+xml' href='http://dhavaldchauhan.blogspot.com/feeds/5338896585739425412/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5272785075638971360/5338896585739425412?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/5338896585739425412'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/5338896585739425412'/><link rel='alternate' type='text/html' href='http://dhavaldchauhan.blogspot.com/2011/12/datatable-xml-to-sql-table-conversion.html' title='Datatable XML to SQL Table Conversion'/><author><name>Dhaval Chauhan</name><uri>http://www.blogger.com/profile/09825343181598773305</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIy30CFXmSnfDgARcOeX5neh8pDl4zf1mlZBUFsolr8Ikyws1Xlvf-1n8mJAZIX8AngQE5IWG91OV1xc9mjvL-VXEhV6TuBleFg-w8UoRCihX8OOD_6q58jTPiCdSr/s220/MyPhoto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5272785075638971360.post-3928046805580356570</id><published>2011-09-28T15:14:00.002+05:30</published><updated>2011-09-28T15:14:46.909+05:30</updated><title type='text'>Get Unique No In SQL - Excel Column Format</title><content type='html'>--&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;Variable Declaration&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&lt;br /&gt;&lt;br /&gt;Declare @LastNo Varchar(max)=&#39;ZZ99999&#39;, &lt;br /&gt;	@NewNo Varchar(max) = &#39;&#39;,&lt;br /&gt;	@NoOfDigit Int = 5, &lt;br /&gt;	@SeriesNo varchar(max) = &#39;&#39;,&lt;br /&gt;	@SeriesChar varchar(max) = &#39;&#39;,&lt;br /&gt;	@SeriesCharOld Varchar(max) = &#39;&#39;,&lt;br /&gt;	@IncrementSeries Bit = 0,&lt;br /&gt;	/*	Char Variable &gt;&gt;&gt;&gt;&gt;*/&lt;br /&gt;	@CharA char(1)=&#39;A&#39;,@CharB char(1)=&#39;B&#39;,@CharC char(1)=&#39;C&#39;,@CharD char(1)=&#39;D&#39;,@CharE char(1)=&#39;E&#39;,&lt;br /&gt;	@CharF char(1)=&#39;F&#39;,@CharG char(1)=&#39;G&#39;,@CharH char(1)=&#39;H&#39;,@CharI char(1)=&#39;I&#39;,@CharJ char(1)=&#39;J&#39;,&lt;br /&gt;	@CharK char(1)=&#39;K&#39;,@CharL char(1)=&#39;L&#39;,@CharM char(1)=&#39;M&#39;,@CharN char(1)=&#39;N&#39;,@CharO char(1)=&#39;O&#39;,&lt;br /&gt;	@CharP char(1)=&#39;P&#39;,@CharQ char(1)=&#39;Q&#39;,@CharR char(1)=&#39;R&#39;,@CharS char(1)=&#39;S&#39;,@CharT char(1)=&#39;T&#39;,&lt;br /&gt;	@CharU char(1)=&#39;U&#39;,@CharV char(1)=&#39;V&#39;,@CharW char(1)=&#39;W&#39;,@CharX char(1)=&#39;X&#39;,@CharY char(1)=&#39;Y&#39;,&lt;br /&gt;	@CharZ char(1)=&#39;Z&#39;&lt;br /&gt;	/*   End Of char Variable&lt;&lt;&lt;&lt;&lt;*/&lt;br /&gt;	Begin Try&lt;br /&gt;	--&gt;&gt;&gt;Get Current Number&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&lt;br /&gt;	Select @LastNo = Case When Len(RTrim(LTrim(@LastNo))) = 0  &lt;br /&gt;					 Then replace(STR(&#39; &#39;,@NoOfDigit),&#39; &#39;,&#39;0&#39;) &lt;br /&gt;					 Else @LastNo End   &lt;br /&gt;	Select @SeriesNo = right(@LastNo,@NoOfDigit)&lt;br /&gt;	&lt;br /&gt;	&lt;br /&gt;	If (@SeriesNo &lt;&gt; Replace(STR(&#39;9&#39;,@NoOfDigit),&#39; &#39;,&#39;9&#39;))&lt;br /&gt;	Begin &lt;br /&gt;		Select @SeriesNo = Replace(replace(str((@SeriesNo + 1),@NoOfDigit),&#39;0&#39;,&#39;0&#39;),&#39; &#39;,&#39;0&#39;)&lt;br /&gt;		Set @SeriesChar = LEFT(@LastNo,LEN(@LastNo) - @NoOfDigit)&lt;br /&gt;		If Len(@SeriesChar) = 0 &lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = @CharA&lt;br /&gt;		End&lt;br /&gt;	End	&lt;br /&gt;	Else&lt;br /&gt;	Begin&lt;br /&gt;		If Len(LTrim(RTrim(@LastNo))) &lt;&gt; 0 &lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesCharOld = LEFT(@LastNo,LEN(@LastNo) - @NoOfDigit)&lt;br /&gt;			Set @IncrementSeries = 1&lt;br /&gt;		End&lt;br /&gt;		Else 	&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = @CharA&lt;br /&gt;		End&lt;br /&gt;		Set @SeriesNo = Replace(STR(1,@NoOfDigit),&#39; &#39;,&#39;0&#39;)&lt;br /&gt;	End&lt;br /&gt;	--&lt;&lt;&lt;End of Get Current Number&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;br /&gt;	--&gt;&gt;&gt;&gt;Get Series Character&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&lt;br /&gt;	&lt;br /&gt;	If (@IncrementSeries = 1)&lt;br /&gt;	Begin&lt;br /&gt;		--Set @SeriesChar = @SeriesCharOld&lt;br /&gt;		Declare @CharLen Int = 0, @LastChar Char(1)=&#39;&#39;&lt;br /&gt;		Set @CharLen = Len(LTrim(RTrim(@SeriesCharOld)))&lt;br /&gt;		Set @LastChar = Substring(LTrim(RTrim(@SeriesCharOld)),@CharLen , 1)&lt;br /&gt;		&lt;br /&gt;		If @LastChar = @CharA&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharB  &lt;br /&gt;		End &lt;br /&gt;		Else If @LastChar = @CharB&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharC  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharC&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharD  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharD&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharE  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharE&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharF  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharF&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharG  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharG&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharH  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharH&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharI  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharI&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharJ  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharJ&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharK  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharK&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharL  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharL&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharM  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharM&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharN  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharN&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharO  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharO&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharP  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharP &lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharQ  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharQ&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharR  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharR&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharS  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharS&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharT  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharT&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharU  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharU&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharV  &lt;br /&gt;		End &lt;br /&gt;		Else If @LastChar = @CharV&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharW  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharW&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharX  &lt;br /&gt;		End &lt;br /&gt;		Else If @LastChar = @CharX&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharY  &lt;br /&gt;		End &lt;br /&gt;		Else If @LastChar = @CharY&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharZ  &lt;br /&gt;		End &lt;br /&gt;		Else If @LastChar = @CharZ&lt;br /&gt;		Begin&lt;br /&gt;			If @SeriesCharOld = Replace(Replace(STR(&#39;0&#39;, Len(@LastNo)-@NoOfDigit) ,&#39; &#39;,@CharZ),&#39;0&#39;,@CharZ)&lt;br /&gt;			Begin&lt;br /&gt;				Set @SeriesChar = @CharA  + Replace(@SeriesCharOld,@CharZ,@CharA)&lt;br /&gt;			End&lt;br /&gt;			Else&lt;br /&gt;			Begin&lt;br /&gt;				Declare @LoopValue Int = 0, @LoopChar char(1) = &#39;&#39;&lt;br /&gt;				Set @LoopValue = @CharLen&lt;br /&gt;				While (@LoopValue&gt;0)&lt;br /&gt;				Begin&lt;br /&gt;					Set @LoopChar = Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue, 1) &lt;br /&gt;					If @LoopChar = @CharZ&lt;br /&gt;					Begin&lt;br /&gt;						print Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharA+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharA+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = @LoopValue - 1								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharA&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharB+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharB&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharC+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharC&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharD+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharD&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharE+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharE&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharF+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharF&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharG+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharG&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharH +Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharH&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharI+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharI&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharJ+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharJ&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharK+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharK&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharL+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharL&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharM+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharM&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharN+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharN&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharO+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharO&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharP+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharP&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharQ+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharQ&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharR+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharR&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharS+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharS&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharT+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharT&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharU+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharU&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharV+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharV&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharW+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharW&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharX+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharX&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharY+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharY&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharZ+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End 		   		  &lt;br /&gt;					Else&lt;br /&gt;					Begin&lt;br /&gt;						Set @LoopValue = @LoopValue - 1								&lt;br /&gt;					End&lt;br /&gt;					&lt;br /&gt;					&lt;br /&gt;				End&lt;br /&gt;				Set @SeriesChar  = @SeriesCharOld&lt;br /&gt;			End&lt;br /&gt;		End &lt;br /&gt;	End&lt;br /&gt;	&lt;br /&gt;	--&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;br /&gt;	--&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;Get Your Unique Number	&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&lt;br /&gt;		Select  @SeriesChar + @SeriesNo&lt;br /&gt;	--&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;	&lt;br /&gt; &lt;br /&gt;	End Try&lt;br /&gt;	Begin Catch&lt;br /&gt;		Select ERROR_MESSAGE() As Error&lt;br /&gt;	End Catch&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhavaldchauhan.blogspot.com/feeds/3928046805580356570/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5272785075638971360/3928046805580356570?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/3928046805580356570'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/3928046805580356570'/><link rel='alternate' type='text/html' href='http://dhavaldchauhan.blogspot.com/2011/09/get-unique-no-in-sql-excel-column.html' title='Get Unique No In SQL - Excel Column Format'/><author><name>Dhaval Chauhan</name><uri>http://www.blogger.com/profile/09825343181598773305</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIy30CFXmSnfDgARcOeX5neh8pDl4zf1mlZBUFsolr8Ikyws1Xlvf-1n8mJAZIX8AngQE5IWG91OV1xc9mjvL-VXEhV6TuBleFg-w8UoRCihX8OOD_6q58jTPiCdSr/s220/MyPhoto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5272785075638971360.post-2803078472628405469</id><published>2011-09-28T15:12:00.003+05:30</published><updated>2011-09-30T19:14:33.893+05:30</updated><title type='text'>Get Unique No In SQL - Excel Column Format</title><content type='html'>--&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;Variable Declaration&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&lt;br /&gt;&lt;br /&gt;Declare @LastNo Varchar(max)=&#39;ZZ99999&#39;, &lt;br /&gt;	@NewNo Varchar(max) = &#39;&#39;,&lt;br /&gt;	@NoOfDigit Int = 5, &lt;br /&gt;	@SeriesNo varchar(max) = &#39;&#39;,&lt;br /&gt;	@SeriesChar varchar(max) = &#39;&#39;,&lt;br /&gt;	@SeriesCharOld Varchar(max) = &#39;&#39;,&lt;br /&gt;	@IncrementSeries Bit = 0,&lt;br /&gt;	/*	Char Variable &gt;&gt;&gt;&gt;&gt;*/&lt;br /&gt;	@CharA char(1)=&#39;A&#39;,@CharB char(1)=&#39;B&#39;,@CharC char(1)=&#39;C&#39;,@CharD char(1)=&#39;D&#39;,@CharE char(1)=&#39;E&#39;,&lt;br /&gt;	@CharF char(1)=&#39;F&#39;,@CharG char(1)=&#39;G&#39;,@CharH char(1)=&#39;H&#39;,@CharI char(1)=&#39;I&#39;,@CharJ char(1)=&#39;J&#39;,&lt;br /&gt;	@CharK char(1)=&#39;K&#39;,@CharL char(1)=&#39;L&#39;,@CharM char(1)=&#39;M&#39;,@CharN char(1)=&#39;N&#39;,@CharO char(1)=&#39;O&#39;,&lt;br /&gt;	@CharP char(1)=&#39;P&#39;,@CharQ char(1)=&#39;Q&#39;,@CharR char(1)=&#39;R&#39;,@CharS char(1)=&#39;S&#39;,@CharT char(1)=&#39;T&#39;,&lt;br /&gt;	@CharU char(1)=&#39;U&#39;,@CharV char(1)=&#39;V&#39;,@CharW char(1)=&#39;W&#39;,@CharX char(1)=&#39;X&#39;,@CharY char(1)=&#39;Y&#39;,&lt;br /&gt;	@CharZ char(1)=&#39;Z&#39;&lt;br /&gt;	/*   End Of char Variable&lt;&lt;&lt;&lt;&lt;*/&lt;br /&gt;	Begin Try&lt;br /&gt;	--&gt;&gt;&gt;Get Current Number&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&lt;br /&gt;	Select @LastNo = Case When Len(RTrim(LTrim(@LastNo))) = 0  &lt;br /&gt;					 Then replace(STR(&#39; &#39;,@NoOfDigit),&#39; &#39;,&#39;0&#39;) &lt;br /&gt;					 Else @LastNo End   &lt;br /&gt;	Select @SeriesNo = right(@LastNo,@NoOfDigit)&lt;br /&gt;	&lt;br /&gt;	&lt;br /&gt;	If (@SeriesNo &lt;&gt; Replace(STR(&#39;9&#39;,@NoOfDigit),&#39; &#39;,&#39;9&#39;))&lt;br /&gt;	Begin &lt;br /&gt;		Select @SeriesNo = Replace(replace(str((@SeriesNo + 1),@NoOfDigit),&#39;0&#39;,&#39;0&#39;),&#39; &#39;,&#39;0&#39;)&lt;br /&gt;		Set @SeriesChar = LEFT(@LastNo,LEN(@LastNo) - @NoOfDigit)&lt;br /&gt;		If Len(@SeriesChar) = 0 &lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = @CharA&lt;br /&gt;		End&lt;br /&gt;	End	&lt;br /&gt;	Else&lt;br /&gt;	Begin&lt;br /&gt;		If Len(LTrim(RTrim(@LastNo))) &lt;&gt; 0 &lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesCharOld = LEFT(@LastNo,LEN(@LastNo) - @NoOfDigit)&lt;br /&gt;			Set @IncrementSeries = 1&lt;br /&gt;		End&lt;br /&gt;		Else 	&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = @CharA&lt;br /&gt;		End&lt;br /&gt;		Set @SeriesNo = Replace(STR(1,@NoOfDigit),&#39; &#39;,&#39;0&#39;)&lt;br /&gt;	End&lt;br /&gt;	--&lt;&lt;&lt;End of Get Current Number&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;br /&gt;	--&gt;&gt;&gt;&gt;Get Series Character&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&lt;br /&gt;	&lt;br /&gt;	If (@IncrementSeries = 1)&lt;br /&gt;	Begin&lt;br /&gt;		--Set @SeriesChar = @SeriesCharOld&lt;br /&gt;		Declare @CharLen Int = 0, @LastChar Char(1)=&#39;&#39;&lt;br /&gt;		Set @CharLen = Len(LTrim(RTrim(@SeriesCharOld)))&lt;br /&gt;		Set @LastChar = Substring(LTrim(RTrim(@SeriesCharOld)),@CharLen , 1)&lt;br /&gt;		&lt;br /&gt;		If @LastChar = @CharA&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharB  &lt;br /&gt;		End &lt;br /&gt;		Else If @LastChar = @CharB&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharC  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharC&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharD  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharD&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharE  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharE&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharF  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharF&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharG  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharG&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharH  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharH&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharI  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharI&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharJ  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharJ&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharK  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharK&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharL  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharL&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharM  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharM&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharN  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharN&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharO  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharO&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharP  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharP &lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharQ  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharQ&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharR  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharR&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharS  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharS&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharT  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharT&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharU  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharU&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharV  &lt;br /&gt;		End &lt;br /&gt;		Else If @LastChar = @CharV&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharW  &lt;br /&gt;		End&lt;br /&gt;		Else If @LastChar = @CharW&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharX  &lt;br /&gt;		End &lt;br /&gt;		Else If @LastChar = @CharX&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharY  &lt;br /&gt;		End &lt;br /&gt;		Else If @LastChar = @CharY&lt;br /&gt;		Begin&lt;br /&gt;			Set @SeriesChar = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @CharLen - 1) &lt;br /&gt;							+ @CharZ  &lt;br /&gt;		End &lt;br /&gt;		Else If @LastChar = @CharZ&lt;br /&gt;		Begin&lt;br /&gt;			If @SeriesCharOld = Replace(Replace(STR(&#39;0&#39;, Len(@LastNo)-@NoOfDigit) ,&#39; &#39;,@CharZ),&#39;0&#39;,@CharZ)&lt;br /&gt;			Begin&lt;br /&gt;				Set @SeriesChar = @CharA  + Replace(@SeriesCharOld,@CharZ,@CharA)&lt;br /&gt;			End&lt;br /&gt;			Else&lt;br /&gt;			Begin&lt;br /&gt;				Declare @LoopValue Int = 0, @LoopChar char(1) = &#39;&#39;&lt;br /&gt;				Set @LoopValue = @CharLen&lt;br /&gt;				While (@LoopValue&gt;0)&lt;br /&gt;				Begin&lt;br /&gt;					Set @LoopChar = Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue, 1) &lt;br /&gt;					If @LoopChar = @CharZ&lt;br /&gt;					Begin&lt;br /&gt;						print Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharA+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharA+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = @LoopValue - 1								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharA&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharB+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharB&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharC+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharC&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharD+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharD&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharE+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharE&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharF+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharF&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharG+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharG&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharH +Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharH&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharI+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharI&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharJ+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharJ&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharK+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharK&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharL+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharL&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharM+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharM&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharN+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharN&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharO+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharO&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharP+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharP&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharQ+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharQ&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharR+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharR&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharS+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharS&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharT+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharT&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharU+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharU&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharV+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharV&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharW+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharW&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharX+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharX&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharY+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End&lt;br /&gt;					Else If @LoopChar = @CharY&lt;br /&gt;					Begin&lt;br /&gt;						Set @SeriesCharOld = Substring(LTrim(RTrim(@SeriesCharOld)), 1, @LoopValue - 1) &lt;br /&gt;						+@CharZ+Substring(LTrim(RTrim(@SeriesCharOld)), @LoopValue + 1, @CharLen) &lt;br /&gt;						Set @LoopValue = 0								&lt;br /&gt;					End 		   		  &lt;br /&gt;					Else&lt;br /&gt;					Begin&lt;br /&gt;						Set @LoopValue = @LoopValue - 1								&lt;br /&gt;					End&lt;br /&gt;					&lt;br /&gt;					&lt;br /&gt;				End&lt;br /&gt;				Set @SeriesChar  = @SeriesCharOld&lt;br /&gt;			End&lt;br /&gt;		End &lt;br /&gt;	End&lt;br /&gt;	&lt;br /&gt;	--&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;br /&gt;	--&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;Get Your Unique Number	&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&lt;br /&gt;		Select  @SeriesChar + @SeriesNo&lt;br /&gt;	--&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;	&lt;br /&gt; &lt;br /&gt;	End Try&lt;br /&gt;	Begin Catch&lt;br /&gt;		Select ERROR_MESSAGE() As Error&lt;br /&gt;	End Catch&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;E.G :&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Input		Output&lt;br /&gt;NULL	---------------&gt;&gt;	A000001&lt;br /&gt;		.&lt;br /&gt;		.&lt;br /&gt;A000001	--------------&gt;&gt;	A000002&lt;br /&gt;		.&lt;br /&gt;		.&lt;br /&gt;AY99999	--------------&gt;&gt;	AZ000001&lt;br /&gt;		.&lt;br /&gt;		.&lt;br /&gt;AZ99999	--------------&gt;&gt;	BA000001&lt;br /&gt;		.&lt;br /&gt;		.&lt;br /&gt;ZY99999	--------------&gt;&gt;	ZZ000001&lt;br /&gt;		.&lt;br /&gt;		.&lt;br /&gt;ZZ99999	---------------&gt;&gt;	AAA000001&lt;br /&gt;		.&lt;br /&gt;		.&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhavaldchauhan.blogspot.com/feeds/2803078472628405469/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5272785075638971360/2803078472628405469?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/2803078472628405469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/2803078472628405469'/><link rel='alternate' type='text/html' href='http://dhavaldchauhan.blogspot.com/2011/09/get-unique-no-in-sql-excel-column_28.html' title='Get Unique No In SQL - Excel Column Format'/><author><name>Dhaval Chauhan</name><uri>http://www.blogger.com/profile/09825343181598773305</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIy30CFXmSnfDgARcOeX5neh8pDl4zf1mlZBUFsolr8Ikyws1Xlvf-1n8mJAZIX8AngQE5IWG91OV1xc9mjvL-VXEhV6TuBleFg-w8UoRCihX8OOD_6q58jTPiCdSr/s220/MyPhoto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5272785075638971360.post-1877043926488678</id><published>2011-09-27T16:13:00.002+05:30</published><updated>2011-09-27T16:14:01.616+05:30</updated><title type='text'>Nth Highest In SQL</title><content type='html'>If Object_Id(&#39;tempdb.dbo.#EmployeeMaster&#39;) Is Not Null&lt;br /&gt;Begin&lt;br /&gt;Drop Table dbo.#EmployeeMaster&lt;br /&gt;End&lt;br /&gt;Go&lt;br /&gt;Create Table dbo.#EmployeeMaster&lt;br /&gt;(&lt;br /&gt; EmpNo Int,&lt;br /&gt; DeptId Int,&lt;br /&gt; Salary Numeric(18,2)&lt;br /&gt;)&lt;br /&gt;Insert Into dbo.#EmployeeMaster values(1,1,4000)&lt;br /&gt;Insert Into dbo.#EmployeeMaster values(2,2,1000)&lt;br /&gt;Insert Into dbo.#EmployeeMaster values(3,3,400)&lt;br /&gt;Insert Into dbo.#EmployeeMaster values(4,1,100)&lt;br /&gt;Insert Into dbo.#EmployeeMaster values(5,2,5000)&lt;br /&gt;Insert Into dbo.#EmployeeMaster values(6,3,25000)&lt;br /&gt;Insert Into dbo.#EmployeeMaster values(7,1,56222)&lt;br /&gt;Insert Into dbo.#EmployeeMaster values(8,2,5652)&lt;br /&gt;Insert Into dbo.#EmployeeMaster values(9,3,1000)&lt;br /&gt;&lt;br /&gt;Select *From dbo.#EmployeeMaster&lt;br /&gt;&lt;br /&gt;Select e.EmpNo, e.DeptId, e.Salary    &lt;br /&gt;From dbo.#EmployeeMaster e&lt;br /&gt;Where 1&gt;=&lt;br /&gt;(Select  COUNT(1) From dbo.#EmployeeMaster e1 &lt;br /&gt;Where e.Salary &lt;= e1.Salary And e.DeptId  = e1.DeptId ) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;=============================================&lt;br /&gt;&lt;br /&gt;(1 row(s) affected)&lt;br /&gt;&lt;br /&gt;(1 row(s) affected)&lt;br /&gt;&lt;br /&gt;(1 row(s) affected)&lt;br /&gt;&lt;br /&gt;(1 row(s) affected)&lt;br /&gt;&lt;br /&gt;(1 row(s) affected)&lt;br /&gt;&lt;br /&gt;(1 row(s) affected)&lt;br /&gt;&lt;br /&gt;(1 row(s) affected)&lt;br /&gt;&lt;br /&gt;(1 row(s) affected)&lt;br /&gt;&lt;br /&gt;(1 row(s) affected)&lt;br /&gt;EmpNo       DeptId      Salary&lt;br /&gt;----------- ----------- ---------------------------------------&lt;br /&gt;1           1           4000.00&lt;br /&gt;2           2           1000.00&lt;br /&gt;3           3           400.00&lt;br /&gt;4           1           100.00&lt;br /&gt;5           2           5000.00&lt;br /&gt;6           3           25000.00&lt;br /&gt;7           1           56222.00&lt;br /&gt;8           2           5652.00&lt;br /&gt;9           3           1000.00&lt;br /&gt;&lt;br /&gt;(9 row(s) affected)&lt;br /&gt;&lt;br /&gt;EmpNo       DeptId      Salary&lt;br /&gt;----------- ----------- ---------------------------------------&lt;br /&gt;6           3           25000.00&lt;br /&gt;7           1           56222.00&lt;br /&gt;8           2           5652.00&lt;br /&gt;&lt;br /&gt;(3 row(s) affected)</content><link rel='replies' type='application/atom+xml' href='http://dhavaldchauhan.blogspot.com/feeds/1877043926488678/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5272785075638971360/1877043926488678?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/1877043926488678'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/1877043926488678'/><link rel='alternate' type='text/html' href='http://dhavaldchauhan.blogspot.com/2011/09/nth-highest-in-sql.html' title='Nth Highest In SQL'/><author><name>Dhaval Chauhan</name><uri>http://www.blogger.com/profile/09825343181598773305</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIy30CFXmSnfDgARcOeX5neh8pDl4zf1mlZBUFsolr8Ikyws1Xlvf-1n8mJAZIX8AngQE5IWG91OV1xc9mjvL-VXEhV6TuBleFg-w8UoRCihX8OOD_6q58jTPiCdSr/s220/MyPhoto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5272785075638971360.post-2394863004308558751</id><published>2011-09-16T12:39:00.002+05:30</published><updated>2011-09-16T12:39:58.721+05:30</updated><title type='text'>Split String to Table</title><content type='html'>If OBJECT_ID(&#39;dbo.UdfSplitStringToTable&#39;) Is Not Null&lt;br /&gt;Begin&lt;br /&gt; Drop Function dbo.UdfSplitStringToTable&lt;br /&gt;End&lt;br /&gt;/*&lt;br /&gt;Function That return Table using split with specified char from string&lt;br /&gt;&lt;br /&gt;e.g:&lt;br /&gt;&lt;br /&gt;Select * From dbo.UdfSplitStringToTable(&#39;1¶2¶3¶4&#39;,&#39;¶&#39;)&lt;br /&gt;*/&lt;br /&gt;Go&lt;br /&gt;Create Function dbo.UdfSplitStringToTable&lt;br /&gt;(&lt;br /&gt; @String varchar(max), &lt;br /&gt; @char char(1)&lt;br /&gt;)&lt;br /&gt;Returns  @Result Table(Item Varchar(max))&lt;br /&gt;As &lt;br /&gt;Begin&lt;br /&gt; &lt;br /&gt; Declare @xDoc XML&lt;br /&gt; Set @xDoc = &#39;&lt;Ids&gt;&lt;Id&gt;&#39;&lt;br /&gt;  + Replace(@String,@char,&#39;&lt;/Id&gt;&lt;Id&gt;&#39;)&lt;br /&gt;  +&#39;&lt;/Id&gt;&lt;/Ids&gt;&#39;&lt;br /&gt; &lt;br /&gt; Insert Into @Result&lt;br /&gt; Select T2.Loc.value(&#39;.&#39;,&#39;Varchar(max)&#39;) &lt;br /&gt; From &lt;br /&gt; @xDoc.nodes(&#39;/Ids/Id&#39;) As T2(Loc)&lt;br /&gt; &lt;br /&gt; Return &lt;br /&gt;End</content><link rel='replies' type='application/atom+xml' href='http://dhavaldchauhan.blogspot.com/feeds/2394863004308558751/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5272785075638971360/2394863004308558751?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/2394863004308558751'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/2394863004308558751'/><link rel='alternate' type='text/html' href='http://dhavaldchauhan.blogspot.com/2011/09/split-string-to-table.html' title='Split String to Table'/><author><name>Dhaval Chauhan</name><uri>http://www.blogger.com/profile/09825343181598773305</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIy30CFXmSnfDgARcOeX5neh8pDl4zf1mlZBUFsolr8Ikyws1Xlvf-1n8mJAZIX8AngQE5IWG91OV1xc9mjvL-VXEhV6TuBleFg-w8UoRCihX8OOD_6q58jTPiCdSr/s220/MyPhoto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5272785075638971360.post-2532050391960217837</id><published>2009-07-03T14:05:00.001+05:30</published><updated>2009-07-03T14:06:06.769+05:30</updated><title type='text'>Storeprocedure as Simple Query</title><content type='html'>begin try&quot;+&lt;br /&gt;                 &quot; begin transaction&quot;+&lt;br /&gt;                 &quot; IF(1=&quot;+intMode.ToString()+&quot;)&quot;+&lt;br /&gt;                 &quot; begin&quot;+&lt;br /&gt;                  //&quot; --Check Exists or Not&quot;+&lt;br /&gt;                        &quot; IF (SELECT count(*)FROM Department_Master_Desktop WHERE Department_Name = &#39;&quot; + strDeptName + &quot;&#39;)=0&quot; +&lt;br /&gt;                    &quot; begin&quot;+&lt;br /&gt;                   //-------Insert Query------------&lt;br /&gt;                   &quot; insert into Department_Master_Desktop ([Department_Id],[Department_Name],[Company_Id],[IsDeleted])&quot;+&lt;br /&gt;                   &quot; (select&quot;+&lt;br /&gt;                    &quot; (select isnull(max(Department_Id),0)+1 from Department_Master_Desktop)&quot;+&lt;br /&gt;                                &quot; ,&#39;&quot;+strDeptName+&quot;&#39;,1,0)&quot; +&lt;br /&gt;                   &quot; select &#39;Inserted&#39; as &#39;Result&#39;&quot;+&lt;br /&gt;                   &quot; commit transaction&quot;+&lt;br /&gt;                     &quot; end&quot;+&lt;br /&gt;                     //Department Already Exists&lt;br /&gt;               &quot; else&quot;+&lt;br /&gt;                  &quot; begin&quot;+&lt;br /&gt;                   //--Exists&lt;br /&gt;                   &quot; RAISERROR(&#39;Department already Exists!&#39;,16,1)&quot;+&lt;br /&gt;                  &quot; end&quot;+&lt;br /&gt;                  &quot; end&quot;+&lt;br /&gt;                     &quot; else if(2=&quot;+intMode.ToString()+&quot;)&quot;+//-------Update Process----&lt;br /&gt;                  &quot; begin &quot;+&lt;br /&gt;                        &quot; IF (SELECT count(*)FROM Department_Master_Desktop WHERE Department_Name = &#39;&quot; + strDeptName + &quot;&#39; and Department_Id&lt;&gt;&quot;+DeptId .ToString()+&quot;)=0&quot; +&lt;br /&gt;                  &quot; begin&quot;+&lt;br /&gt;                   &quot; update Department_Master_Desktop set Department_Name=&#39;&quot;+strDeptName+&quot;&#39; where Department_Id=&quot;+DeptId.ToString()+&lt;br /&gt;                   &quot; commit transaction&quot;+&lt;br /&gt;                   &quot; select &#39;Updated&#39; as &#39;Result&#39;&quot;+&lt;br /&gt;                  &quot; end&quot;+&lt;br /&gt;                        &quot; else&quot;+//--Department Already Exists&lt;br /&gt;                  &quot; begin&quot;+&lt;br /&gt;               //--Exists&lt;br /&gt;                   &quot; RAISERROR(&#39;Department already Exists!&#39;,16,1)&quot;+&lt;br /&gt;            &lt;br /&gt;                  &quot; end&quot;+&lt;br /&gt;                   &quot; end &quot;+&lt;br /&gt;                 &quot; else if(3=&quot;+intMode.ToString()+&quot;)&quot;+//--Delete Operation&lt;br /&gt;                 &quot; begin&quot;+&lt;br /&gt;                  &quot; delete Department_Master_Desktop where Department_Id=&quot;+DeptId.ToString()+&lt;br /&gt;                  &quot; commit transaction &quot;+&lt;br /&gt;                  &quot; select &#39;Deleted&#39; as &#39;Result&#39;&quot;+&lt;br /&gt;                 &quot; end &quot;+&lt;br /&gt;                 &quot; else if(4=&quot;+intMode.ToString()+&quot;)&quot;+//--Select Opration&lt;br /&gt;                   &quot; begin&quot;+&lt;br /&gt;                        &quot; select Department_Id,Department_Name from Department_Master_Desktop&quot; +&lt;br /&gt;                  &quot; commit transaction&quot;+ &lt;br /&gt;                   &quot; end&quot;+&lt;br /&gt;                 &quot; else&quot;+&lt;br /&gt;                 &quot; begin&quot;+ &lt;br /&gt;                  &quot; RAISERROR(&#39;No Operation Found!&#39;,16,1)&quot;+&lt;br /&gt;                 &quot; end&quot;+&lt;br /&gt;                &quot; end try&quot;+//--end try&lt;br /&gt;                &quot; begin catch&quot;+ //--start catch&lt;br /&gt;                  &quot; rollback transaction&quot;+&lt;br /&gt;                  &quot; select ERROR_MESSAGE() as &#39;Error&#39;&quot;+&lt;br /&gt;                &quot; end catch</content><link rel='replies' type='application/atom+xml' href='http://dhavaldchauhan.blogspot.com/feeds/2532050391960217837/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5272785075638971360/2532050391960217837?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/2532050391960217837'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/2532050391960217837'/><link rel='alternate' type='text/html' href='http://dhavaldchauhan.blogspot.com/2009/07/storeprocedure-as-simple-query.html' title='Storeprocedure as Simple Query'/><author><name>Dhaval Chauhan</name><uri>http://www.blogger.com/profile/09825343181598773305</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIy30CFXmSnfDgARcOeX5neh8pDl4zf1mlZBUFsolr8Ikyws1Xlvf-1n8mJAZIX8AngQE5IWG91OV1xc9mjvL-VXEhV6TuBleFg-w8UoRCihX8OOD_6q58jTPiCdSr/s220/MyPhoto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5272785075638971360.post-4587729308198152854</id><published>2009-06-11T10:31:00.002+05:30</published><updated>2009-06-11T10:33:43.061+05:30</updated><title type='text'>Encryption - Decryption Class</title><content type='html'>using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Text;&lt;br /&gt;using System.Security.Cryptography;&lt;br /&gt;using System.IO;&lt;br /&gt;&lt;br /&gt;namespace Project_NameSpace.Classes&lt;br /&gt;{&lt;br /&gt;    public class EncDec&lt;br /&gt;    {&lt;br /&gt;        public EncDec()&lt;br /&gt;        { }&lt;br /&gt;        public void Dispose()&lt;br /&gt;        {&lt;br /&gt;            GC.Collect();&lt;br /&gt;            GC.SuppressFinalize(this);&lt;br /&gt;            GC.WaitForPendingFinalizers();&lt;br /&gt;            //GC.GetTotalMemory(true);&lt;br /&gt;        }&lt;br /&gt;        ///# byte[] Encrypt(byte[] clearData, byte[] Key, byte[] IV) - encrypts a byte array with a key and an IV and returns a byte array;&lt;br /&gt;        ///# string Encrypt(string clearText, string Password) - encrypts a string with a password and returns a string;&lt;br /&gt;        ///# byte[] Encrypt(byte[] clearData, string Password) - encrypts a byte array with a password and returns a byte array;&lt;br /&gt;        ///# void Encrypt(string fileIn, string fileOut, string Password) - encrypts a file with a password and writes the encrypted bytes into another file.&lt;br /&gt;        ///&lt;br /&gt;        // Encrypt a byte array into a byte array using a key and an IV &lt;br /&gt;&lt;br /&gt;        public static byte[] Encrypt(byte[] clearData, byte[] Key, byte[] IV)&lt;br /&gt;        {&lt;br /&gt;            // Create a MemoryStream to accept the encrypted bytes &lt;br /&gt;&lt;br /&gt;            MemoryStream ms = new MemoryStream();&lt;br /&gt;&lt;br /&gt;            // Create a symmetric algorithm. We are going to use Rijndael because it is strong and&lt;br /&gt;            // available on all platforms. &lt;br /&gt;            // You can use other algorithms, to do so substitute the&lt;br /&gt;            // next line with something like &lt;br /&gt;            //      TripleDES alg = TripleDES.Create(); &lt;br /&gt;&lt;br /&gt;            Rijndael alg = Rijndael.Create();&lt;br /&gt;&lt;br /&gt;            // Now set the key and the IV. &lt;br /&gt;            // We need the IV (Initialization Vector) because&lt;br /&gt;            // the algorithm is operating in its default &lt;br /&gt;            // mode called CBC (Cipher Block Chaining).&lt;br /&gt;            // The IV is XORed with the first block (8 byte) &lt;br /&gt;            // of the data before it is encrypted, and then each&lt;br /&gt;            // encrypted block is XORed with the &lt;br /&gt;            // following block of plaintext.&lt;br /&gt;            // This is done to make encryption more secure. &lt;br /&gt;            // There is also a mode called ECB which does not need an IV,&lt;br /&gt;            // but it is much less secure. &lt;br /&gt;            alg.Key = Key;&lt;br /&gt;            alg.IV = IV;&lt;br /&gt;            // Create a CryptoStream through which we are going to be&lt;br /&gt;            // pumping our data. &lt;br /&gt;            // CryptoStreamMode.Write means that we are going to be&lt;br /&gt;            // writing data to the stream and the output will be written&lt;br /&gt;            // in the MemoryStream we have provided. &lt;br /&gt;            CryptoStream cs = new CryptoStream(ms,&lt;br /&gt;               alg.CreateEncryptor(), CryptoStreamMode.Write);&lt;br /&gt;&lt;br /&gt;            // Write the data and make it do the encryption &lt;br /&gt;&lt;br /&gt;            cs.Write(clearData, 0, clearData.Length);&lt;br /&gt;&lt;br /&gt;            // Close the crypto stream (or do FlushFinalBlock). &lt;br /&gt;            // This will tell it that we have done our encryption and&lt;br /&gt;            // there is no more data coming in, &lt;br /&gt;            // and it is now a good time to apply the padding and&lt;br /&gt;            // finalize the encryption process. &lt;br /&gt;&lt;br /&gt;            cs.Close();&lt;br /&gt;&lt;br /&gt;            // Now get the encrypted data from the MemoryStream.&lt;br /&gt;            // Some people make a mistake of using GetBuffer() here,&lt;br /&gt;            // which is not the right way. &lt;br /&gt;&lt;br /&gt;            byte[] encryptedData = ms.ToArray();&lt;br /&gt;&lt;br /&gt;            return encryptedData;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        // Encrypt a string into a string using a password &lt;br /&gt;        //    Uses Encrypt(byte[], byte[], byte[]) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        public static string Encrypt(string clearText, string Password)&lt;br /&gt;        {&lt;br /&gt;            // First we need to turn the input string into a byte array. &lt;br /&gt;            byte[] clearBytes =&lt;br /&gt;              System.Text.Encoding.Unicode.GetBytes(clearText);&lt;br /&gt;&lt;br /&gt;            // Then, we need to turn the password into Key and IV &lt;br /&gt;&lt;br /&gt;            // We are using salt to make it harder to guess our key&lt;br /&gt;&lt;br /&gt;            // using a dictionary attack - &lt;br /&gt;&lt;br /&gt;            // trying to guess a password by enumerating all possible words. &lt;br /&gt;&lt;br /&gt;            PasswordDeriveBytes pdb = new PasswordDeriveBytes(Password,&lt;br /&gt;                new byte[] {0x49, 0x76, 0x61, 0x6e, 0x20, 0x4d, &lt;br /&gt;            0x65, 0x64, 0x76, 0x65, 0x64, 0x65, 0x76});&lt;br /&gt;&lt;br /&gt;            // Now get the key/IV and do the encryption using the&lt;br /&gt;            // function that accepts byte arrays. &lt;br /&gt;            // Using PasswordDeriveBytes object we are first getting&lt;br /&gt;            // 32 bytes for the Key &lt;br /&gt;            // (the default Rijndael key length is 256bit = 32bytes)&lt;br /&gt;            // and then 16 bytes for the IV. &lt;br /&gt;            // IV should always be the block size, which is by default&lt;br /&gt;            // 16 bytes (128 bit) for Rijndael. &lt;br /&gt;            // If you are using DES/TripleDES/RC2 the block size is&lt;br /&gt;            // 8 bytes and so should be the IV size. &lt;br /&gt;            // You can also read KeySize/BlockSize properties off&lt;br /&gt;            // the algorithm to find out the sizes. &lt;br /&gt;&lt;br /&gt;            byte[] encryptedData = Encrypt(clearBytes,&lt;br /&gt;                     pdb.GetBytes(32), pdb.GetBytes(16));&lt;br /&gt;&lt;br /&gt;            // Now we need to turn the resulting byte array into a string. &lt;br /&gt;            // A common mistake would be to use an Encoding class for that.&lt;br /&gt;            //It does not work because not all byte values can be&lt;br /&gt;            // represented by characters. &lt;br /&gt;            // We are going to be using Base64 encoding that is designed&lt;br /&gt;            //exactly for what we are trying to do. &lt;br /&gt;&lt;br /&gt;            return Convert.ToBase64String(encryptedData);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        /// Encrypt bytes into bytes using a password &lt;br /&gt;        ///  Uses Encrypt(byte[], byte[], byte[]) &lt;br /&gt;        ///  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        public static byte[] Encrypt(byte[] clearData, string Password)&lt;br /&gt;        {&lt;br /&gt;            // We need to turn the password into Key and IV. &lt;br /&gt;            // We are using salt to make it harder to guess our key&lt;br /&gt;            // using a dictionary attack - &lt;br /&gt;&lt;br /&gt;            // trying to guess a password by enumerating all possible words. &lt;br /&gt;&lt;br /&gt;            PasswordDeriveBytes pdb = new PasswordDeriveBytes(Password,&lt;br /&gt;                new byte[] {0x49, 0x76, 0x61, 0x6e, 0x20, 0x4d, &lt;br /&gt;            0x65, 0x64, 0x76, 0x65, 0x64, 0x65, 0x76});&lt;br /&gt;&lt;br /&gt;            // Now get the key/IV and do the encryption using the function&lt;br /&gt;            // that accepts byte arrays. &lt;br /&gt;            // Using PasswordDeriveBytes object we are first getting&lt;br /&gt;            // 32 bytes for the Key &lt;br /&gt;            // (the default Rijndael key length is 256bit = 32bytes)&lt;br /&gt;            // and then 16 bytes for the IV. &lt;br /&gt;            // IV should always be the block size, which is by default&lt;br /&gt;            // 16 bytes (128 bit) for Rijndael. &lt;br /&gt;            // If you are using DES/TripleDES/RC2 the block size is 8&lt;br /&gt;            // bytes and so should be the IV size. &lt;br /&gt;            // You can also read KeySize/BlockSize properties off the&lt;br /&gt;            // algorithm to find out the sizes. &lt;br /&gt;            return Encrypt(clearData, pdb.GetBytes(32), pdb.GetBytes(16));&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        // Encrypt a file into another file using a password &lt;br /&gt;&lt;br /&gt;        public static void Encrypt(string fileIn,&lt;br /&gt;                    string fileOut, string Password)&lt;br /&gt;        {&lt;br /&gt;&lt;br /&gt;            // First we are going to open the file streams &lt;br /&gt;&lt;br /&gt;            FileStream fsIn = new FileStream(fileIn,&lt;br /&gt;                FileMode.Open, FileAccess.Read);&lt;br /&gt;            FileStream fsOut = new FileStream(fileOut,&lt;br /&gt;                FileMode.OpenOrCreate, FileAccess.Write);&lt;br /&gt;&lt;br /&gt;            // Then we are going to derive a Key and an IV from the&lt;br /&gt;            // Password and create an algorithm &lt;br /&gt;&lt;br /&gt;            PasswordDeriveBytes pdb = new PasswordDeriveBytes(Password,&lt;br /&gt;                new byte[] {0x49, 0x76, 0x61, 0x6e, 0x20, 0x4d, &lt;br /&gt;            0x65, 0x64, 0x76, 0x65, 0x64, 0x65, 0x76});&lt;br /&gt;&lt;br /&gt;            Rijndael alg = Rijndael.Create();&lt;br /&gt;            alg.Key = pdb.GetBytes(32);&lt;br /&gt;            alg.IV = pdb.GetBytes(16);&lt;br /&gt;&lt;br /&gt;            // Now create a crypto stream through which we are going&lt;br /&gt;            // to be pumping data. &lt;br /&gt;            // Our fileOut is going to be receiving the encrypted bytes. &lt;br /&gt;&lt;br /&gt;            CryptoStream cs = new CryptoStream(fsOut,&lt;br /&gt;                alg.CreateEncryptor(), CryptoStreamMode.Write);&lt;br /&gt;&lt;br /&gt;            // Now will will initialize a buffer and will be processing&lt;br /&gt;            // the input file in chunks. &lt;br /&gt;            // This is done to avoid reading the whole file (which can&lt;br /&gt;            // be huge) into memory. &lt;br /&gt;&lt;br /&gt;            int bufferLen = 4096;&lt;br /&gt;            byte[] buffer = new byte[0];&lt;br /&gt;            int bytesRead;&lt;br /&gt;&lt;br /&gt;            do&lt;br /&gt;            {&lt;br /&gt;                // read a chunk of data from the input file &lt;br /&gt;&lt;br /&gt;                bytesRead = fsIn.Read(buffer, 0, bufferLen);&lt;br /&gt;&lt;br /&gt;                // encrypt it &lt;br /&gt;&lt;br /&gt;                cs.Write(buffer, 0, bytesRead);&lt;br /&gt;            } while (bytesRead != 0);&lt;br /&gt;&lt;br /&gt;            // close everything &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;            // this will also close the unrelying fsOut stream&lt;br /&gt;&lt;br /&gt;            cs.Close();&lt;br /&gt;            fsIn.Close();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        // Decrypt a byte array into a byte array using a key and an IV &lt;br /&gt;&lt;br /&gt;        public static byte[] Decrypt(byte[] cipherData,&lt;br /&gt;                                    byte[] Key, byte[] IV)&lt;br /&gt;        {&lt;br /&gt;            // Create a MemoryStream that is going to accept the&lt;br /&gt;&lt;br /&gt;            // decrypted bytes &lt;br /&gt;&lt;br /&gt;            MemoryStream ms = new MemoryStream();&lt;br /&gt;&lt;br /&gt;            // Create a symmetric algorithm. &lt;br /&gt;&lt;br /&gt;            // We are going to use Rijndael because it is strong and&lt;br /&gt;&lt;br /&gt;            // available on all platforms. &lt;br /&gt;&lt;br /&gt;            // You can use other algorithms, to do so substitute the next&lt;br /&gt;&lt;br /&gt;            // line with something like &lt;br /&gt;&lt;br /&gt;            //     TripleDES alg = TripleDES.Create(); &lt;br /&gt;&lt;br /&gt;            Rijndael alg = Rijndael.Create();&lt;br /&gt;&lt;br /&gt;            // Now set the key and the IV. &lt;br /&gt;&lt;br /&gt;            // We need the IV (Initialization Vector) because the algorithm&lt;br /&gt;&lt;br /&gt;            // is operating in its default &lt;br /&gt;&lt;br /&gt;            // mode called CBC (Cipher Block Chaining). The IV is XORed with&lt;br /&gt;&lt;br /&gt;            // the first block (8 byte) &lt;br /&gt;&lt;br /&gt;            // of the data after it is decrypted, and then each decrypted&lt;br /&gt;&lt;br /&gt;            // block is XORed with the previous &lt;br /&gt;&lt;br /&gt;            // cipher block. This is done to make encryption more secure. &lt;br /&gt;&lt;br /&gt;            // There is also a mode called ECB which does not need an IV,&lt;br /&gt;&lt;br /&gt;            // but it is much less secure. &lt;br /&gt;&lt;br /&gt;            alg.Key = Key;&lt;br /&gt;            alg.IV = IV;&lt;br /&gt;&lt;br /&gt;            // Create a CryptoStream through which we are going to be&lt;br /&gt;&lt;br /&gt;            // pumping our data. &lt;br /&gt;&lt;br /&gt;            // CryptoStreamMode.Write means that we are going to be&lt;br /&gt;&lt;br /&gt;            // writing data to the stream &lt;br /&gt;&lt;br /&gt;            // and the output will be written in the MemoryStream&lt;br /&gt;&lt;br /&gt;            // we have provided. &lt;br /&gt;&lt;br /&gt;            CryptoStream cs = new CryptoStream(ms,&lt;br /&gt;                alg.CreateDecryptor(), CryptoStreamMode.Write);&lt;br /&gt;&lt;br /&gt;            // Write the data and make it do the decryption &lt;br /&gt;&lt;br /&gt;            cs.Write(cipherData, 0, cipherData.Length);&lt;br /&gt;&lt;br /&gt;            // Close the crypto stream (or do FlushFinalBlock). &lt;br /&gt;&lt;br /&gt;            // This will tell it that we have done our decryption&lt;br /&gt;&lt;br /&gt;            // and there is no more data coming in, &lt;br /&gt;&lt;br /&gt;            // and it is now a good time to remove the padding&lt;br /&gt;&lt;br /&gt;            // and finalize the decryption process. &lt;br /&gt;&lt;br /&gt;            cs.Close();&lt;br /&gt;&lt;br /&gt;            // Now get the decrypted data from the MemoryStream. &lt;br /&gt;&lt;br /&gt;            // Some people make a mistake of using GetBuffer() here,&lt;br /&gt;&lt;br /&gt;            // which is not the right way. &lt;br /&gt;&lt;br /&gt;            byte[] decryptedData = ms.ToArray();&lt;br /&gt;&lt;br /&gt;            return decryptedData;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        // Decrypt a string into a string using a password &lt;br /&gt;&lt;br /&gt;        //    Uses Decrypt(byte[], byte[], byte[]) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        public static string Decrypt(string cipherText, string Password)&lt;br /&gt;        {&lt;br /&gt;            // First we need to turn the input string into a byte array. &lt;br /&gt;&lt;br /&gt;            // We presume that Base64 encoding was used &lt;br /&gt;&lt;br /&gt;            byte[] cipherBytes = Convert.FromBase64String(cipherText);&lt;br /&gt;&lt;br /&gt;            // Then, we need to turn the password into Key and IV &lt;br /&gt;&lt;br /&gt;            // We are using salt to make it harder to guess our key&lt;br /&gt;&lt;br /&gt;            // using a dictionary attack - &lt;br /&gt;&lt;br /&gt;            // trying to guess a password by enumerating all possible words. &lt;br /&gt;&lt;br /&gt;            PasswordDeriveBytes pdb = new PasswordDeriveBytes(Password,&lt;br /&gt;                new byte[] {0x49, 0x76, 0x61, 0x6e, 0x20, 0x4d, 0x65, &lt;br /&gt;            0x64, 0x76, 0x65, 0x64, 0x65, 0x76});&lt;br /&gt;&lt;br /&gt;            // Now get the key/IV and do the decryption using&lt;br /&gt;&lt;br /&gt;            // the function that accepts byte arrays. &lt;br /&gt;&lt;br /&gt;            // Using PasswordDeriveBytes object we are first&lt;br /&gt;&lt;br /&gt;            // getting 32 bytes for the Key &lt;br /&gt;&lt;br /&gt;            // (the default Rijndael key length is 256bit = 32bytes)&lt;br /&gt;&lt;br /&gt;            // and then 16 bytes for the IV. &lt;br /&gt;&lt;br /&gt;            // IV should always be the block size, which is by&lt;br /&gt;&lt;br /&gt;            // default 16 bytes (128 bit) for Rijndael. &lt;br /&gt;&lt;br /&gt;            // If you are using DES/TripleDES/RC2 the block size is&lt;br /&gt;&lt;br /&gt;            // 8 bytes and so should be the IV size. &lt;br /&gt;&lt;br /&gt;            // You can also read KeySize/BlockSize properties off&lt;br /&gt;&lt;br /&gt;            // the algorithm to find out the sizes. &lt;br /&gt;&lt;br /&gt;            byte[] decryptedData = Decrypt(cipherBytes,&lt;br /&gt;                pdb.GetBytes(32), pdb.GetBytes(16));&lt;br /&gt;&lt;br /&gt;            // Now we need to turn the resulting byte array into a string. &lt;br /&gt;&lt;br /&gt;            // A common mistake would be to use an Encoding class for that.&lt;br /&gt;&lt;br /&gt;            // It does not work &lt;br /&gt;&lt;br /&gt;            // because not all byte values can be represented by characters. &lt;br /&gt;&lt;br /&gt;            // We are going to be using Base64 encoding that is &lt;br /&gt;&lt;br /&gt;            // designed exactly for what we are trying to do. &lt;br /&gt;&lt;br /&gt;            return System.Text.Encoding.Unicode.GetString(decryptedData);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        // Decrypt bytes into bytes using a password &lt;br /&gt;&lt;br /&gt;        //    Uses Decrypt(byte[], byte[], byte[]) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        public static byte[] Decrypt(byte[] cipherData, string Password)&lt;br /&gt;        {&lt;br /&gt;            // We need to turn the password into Key and IV. &lt;br /&gt;&lt;br /&gt;            // We are using salt to make it harder to guess our key&lt;br /&gt;&lt;br /&gt;            // using a dictionary attack - &lt;br /&gt;&lt;br /&gt;            // trying to guess a password by enumerating all possible words. &lt;br /&gt;&lt;br /&gt;            PasswordDeriveBytes pdb = new PasswordDeriveBytes(Password,&lt;br /&gt;                new byte[] {0x49, 0x76, 0x61, 0x6e, 0x20, 0x4d, &lt;br /&gt;            0x65, 0x64, 0x76, 0x65, 0x64, 0x65, 0x76});&lt;br /&gt;&lt;br /&gt;            // Now get the key/IV and do the Decryption using the &lt;br /&gt;&lt;br /&gt;            //function that accepts byte arrays. &lt;br /&gt;&lt;br /&gt;            // Using PasswordDeriveBytes object we are first getting&lt;br /&gt;&lt;br /&gt;            // 32 bytes for the Key &lt;br /&gt;&lt;br /&gt;            // (the default Rijndael key length is 256bit = 32bytes)&lt;br /&gt;&lt;br /&gt;            // and then 16 bytes for the IV. &lt;br /&gt;&lt;br /&gt;            // IV should always be the block size, which is by default&lt;br /&gt;&lt;br /&gt;            // 16 bytes (128 bit) for Rijndael. &lt;br /&gt;&lt;br /&gt;            // If you are using DES/TripleDES/RC2 the block size is&lt;br /&gt;&lt;br /&gt;            // 8 bytes and so should be the IV size. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;            // You can also read KeySize/BlockSize properties off the&lt;br /&gt;&lt;br /&gt;            // algorithm to find out the sizes. &lt;br /&gt;&lt;br /&gt;            return Decrypt(cipherData, pdb.GetBytes(32), pdb.GetBytes(16));&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        // Decrypt a file into another file using a password &lt;br /&gt;&lt;br /&gt;        public static void Decrypt(string fileIn,&lt;br /&gt;                    string fileOut, string Password)&lt;br /&gt;        {&lt;br /&gt;&lt;br /&gt;            // First we are going to open the file streams &lt;br /&gt;&lt;br /&gt;            FileStream fsIn = new FileStream(fileIn,&lt;br /&gt;                        FileMode.Open, FileAccess.Read);&lt;br /&gt;            FileStream fsOut = new FileStream(fileOut,&lt;br /&gt;                        FileMode.OpenOrCreate, FileAccess.Write);&lt;br /&gt;&lt;br /&gt;            // Then we are going to derive a Key and an IV from&lt;br /&gt;&lt;br /&gt;            // the Password and create an algorithm &lt;br /&gt;&lt;br /&gt;            PasswordDeriveBytes pdb = new PasswordDeriveBytes(Password,&lt;br /&gt;                new byte[] {0x49, 0x76, 0x61, 0x6e, 0x20, 0x4d, &lt;br /&gt;            0x65, 0x64, 0x76, 0x65, 0x64, 0x65, 0x76});&lt;br /&gt;            Rijndael alg = Rijndael.Create();&lt;br /&gt;&lt;br /&gt;            alg.Key = pdb.GetBytes(32);&lt;br /&gt;            alg.IV = pdb.GetBytes(16);&lt;br /&gt;&lt;br /&gt;            // Now create a crypto stream through which we are going&lt;br /&gt;&lt;br /&gt;            // to be pumping data. &lt;br /&gt;&lt;br /&gt;            // Our fileOut is going to be receiving the Decrypted bytes. &lt;br /&gt;&lt;br /&gt;            CryptoStream cs = new CryptoStream(fsOut,&lt;br /&gt;                alg.CreateDecryptor(), CryptoStreamMode.Write);&lt;br /&gt;&lt;br /&gt;            // Now will will initialize a buffer and will be &lt;br /&gt;&lt;br /&gt;            // processing the input file in chunks. &lt;br /&gt;&lt;br /&gt;            // This is done to avoid reading the whole file (which can be&lt;br /&gt;&lt;br /&gt;            // huge) into memory. &lt;br /&gt;&lt;br /&gt;            int bufferLen = 4096;&lt;br /&gt;            byte[] buffer = new byte[0];&lt;br /&gt;            int bytesRead;&lt;br /&gt;&lt;br /&gt;            do&lt;br /&gt;            {&lt;br /&gt;                // read a chunk of data from the input file &lt;br /&gt;&lt;br /&gt;                bytesRead = fsIn.Read(buffer, 0, bufferLen);&lt;br /&gt;&lt;br /&gt;                // Decrypt it &lt;br /&gt;&lt;br /&gt;                cs.Write(buffer, 0, bytesRead);&lt;br /&gt;&lt;br /&gt;            } while (bytesRead != 0);&lt;br /&gt;&lt;br /&gt;            // close everything &lt;br /&gt;&lt;br /&gt;            cs.Close(); // this will also close the unrelying fsOut stream &lt;br /&gt;&lt;br /&gt;            fsIn.Close();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}</content><link rel='replies' type='application/atom+xml' href='http://dhavaldchauhan.blogspot.com/feeds/4587729308198152854/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5272785075638971360/4587729308198152854?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/4587729308198152854'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/4587729308198152854'/><link rel='alternate' type='text/html' href='http://dhavaldchauhan.blogspot.com/2009/06/encryption-decryption-class.html' title='Encryption - Decryption Class'/><author><name>Dhaval Chauhan</name><uri>http://www.blogger.com/profile/09825343181598773305</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIy30CFXmSnfDgARcOeX5neh8pDl4zf1mlZBUFsolr8Ikyws1Xlvf-1n8mJAZIX8AngQE5IWG91OV1xc9mjvL-VXEhV6TuBleFg-w8UoRCihX8OOD_6q58jTPiCdSr/s220/MyPhoto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5272785075638971360.post-2012008456170809696</id><published>2009-06-11T10:29:00.004+05:30</published><updated>2009-06-11T10:56:14.338+05:30</updated><title type='text'>Database connection Class</title><content type='html'>using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Text;&lt;br /&gt;using System.Data.SqlClient;&lt;br /&gt;using System.Collections ;&lt;br /&gt;using System.IO;&lt;br /&gt;using System.ComponentModel;&lt;br /&gt;using System.Net;&lt;br /&gt;using System.Windows.Forms;&lt;br /&gt;using System.Data;&lt;br /&gt;using System.Configuration;&lt;br /&gt;using System.Xml;&lt;br /&gt;//Below namespace is for execute sql-file by programatically&lt;br /&gt;using Microsoft.SqlServer.Management.Smo;&lt;br /&gt;using Microsoft.SqlServer.Management.Common; &lt;br /&gt;namespace Project_NameSpace.Classes&lt;br /&gt;{&lt;br /&gt;    class clsDataOperation&lt;br /&gt;    {&lt;br /&gt;        public string ErrorMessage = &quot;&quot;,strDatabase = &quot;&quot;, strUsername = &quot;&quot;, strPassword = &quot;&quot;, strAppName = &quot;&quot;, strServer = &quot;&quot;, strDbAutMod = &quot;&quot;;&lt;br /&gt;        public string  strToCreateDbName=&quot;&quot;;&lt;br /&gt;        private SqlConnection conn;&lt;br /&gt;        private SqlCommand comm=new SqlCommand();&lt;br /&gt;        public void SetAppConfigData()&lt;br /&gt;        {&lt;br /&gt;            strDatabase = ConfigurationSettings.AppSettings[&quot;database&quot;].ToString();&lt;br /&gt;            strUsername = ConfigurationSettings.AppSettings[&quot;username&quot;].ToString();&lt;br /&gt;            strPassword = ConfigurationSettings.AppSettings[&quot;password&quot;].ToString();&lt;br /&gt;            strAppName = ConfigurationSettings.AppSettings[&quot;Application&quot;].ToString();&lt;br /&gt;            strServer = ConfigurationSettings.AppSettings[&quot;server&quot;].ToString();&lt;br /&gt;            strDbAutMod = ConfigurationSettings.AppSettings[&quot;Mode&quot;].ToString();&lt;br /&gt;        }&lt;br /&gt;        public bool CheckDataBase()&lt;br /&gt;        {&lt;br /&gt;            bool bRet = false;&lt;br /&gt;            if (OpenMasterDbConn())//Check Master Database connection open or not&lt;br /&gt;            {&lt;br /&gt;                SetAppConfigData();&lt;br /&gt;                strToCreateDbName = strDatabase;//Set string database name to create&lt;br /&gt;                string cmdText = &quot;select * from dbo.sysdatabases where name=&#39;&quot; + strDatabase + &quot;&#39;&quot;;&lt;br /&gt;                DataSet ds = ExecMasterDbQry(cmdText, &quot;Database&quot;);&lt;br /&gt;                if (ds.Tables[0].Rows.Count &gt; 0)&lt;br /&gt;                {&lt;br /&gt;                    bRet = true;&lt;br /&gt;                }&lt;br /&gt;&lt;br /&gt;                CloseConnection();&lt;br /&gt;                return bRet;&lt;br /&gt;            }&lt;br /&gt;            return bRet;&lt;br /&gt;        }&lt;br /&gt;        public bool CreateDatabase(string strDbScript)&lt;br /&gt;        {&lt;br /&gt;            bool bRet = false;&lt;br /&gt;            try&lt;br /&gt;            {&lt;br /&gt;                OpenMasterDbConn();&lt;br /&gt;                &lt;br /&gt;                string cmdText1 = &quot;create database &quot; + strToCreateDbName;&lt;br /&gt;                ExecNonQuery(cmdText1, &quot;Database&quot;);&lt;br /&gt;                string cmdText = strDbScript;&lt;br /&gt;                string qry = &quot;use &quot; + strToCreateDbName;&lt;br /&gt;                conn.Open();&lt;br /&gt;                comm.CommandText = qry;&lt;br /&gt;                comm.ExecuteNonQuery();&lt;br /&gt;                Server server = new Server(new ServerConnection(conn));&lt;br /&gt;                server.ConnectionContext.ExecuteNonQuery(cmdText);&lt;br /&gt;                CloseConnection();&lt;br /&gt;            }&lt;br /&gt;            catch &lt;br /&gt;            {&lt;br /&gt;                if (CheckDataBase())&lt;br /&gt;                {&lt;br /&gt;                    OpenMasterDbConn();&lt;br /&gt;                    conn.Open();&lt;br /&gt;                    comm.CommandText = &quot;drop &quot;+strToCreateDbName;&lt;br /&gt;                    comm.ExecuteNonQuery();&lt;br /&gt;                    conn.Close();&lt;br /&gt;                    CloseConnection();&lt;br /&gt;                    //Server server = new Server();&lt;br /&gt;                    //string abc=server.ActiveDirectory.UserData.ToString(); &lt;br /&gt;                    &lt;br /&gt;                }&lt;br /&gt;                bRet = false;&lt;br /&gt;            }&lt;br /&gt;            return bRet;&lt;br /&gt;        }&lt;br /&gt;        public void ExecNonQuery(string qry, string tablename)&lt;br /&gt;        {&lt;br /&gt;            try&lt;br /&gt;            {&lt;br /&gt;                OpenMasterDbConn();&lt;br /&gt;                comm.CommandText = qry;&lt;br /&gt;                comm.CommandType = CommandType.Text;&lt;br /&gt;                comm.ExecuteNonQuery();&lt;br /&gt;            }&lt;br /&gt;            catch (SqlException ex)&lt;br /&gt;            {&lt;br /&gt;                //this.ErrorMessage = &quot;SqlException: &quot; + ex.Message + &quot; // SqlErrorNumber:- &quot; + ex.Number;&lt;br /&gt;                //string strXml = &quot;&lt;NewDataSet&gt;&lt;&quot; + tablename + &quot;&gt;&lt;ISSUCCESS&gt;100&lt;/ISSUCCESS&gt;&lt;ERRORMESSAGE&gt;&quot; + this.ErrorMessage + &quot;&lt;/ERRORMESSAGE&gt;&lt;/&quot; + tablename + &quot;&gt;&lt;/NewDataSet&gt;&quot;;&lt;br /&gt;                //StringReader oSr = new StringReader(strXml);&lt;br /&gt;                //ds.ReadXml(oSr);&lt;br /&gt;                //return ds;&lt;br /&gt;            }&lt;br /&gt;            catch (Exception ex)&lt;br /&gt;            {&lt;br /&gt;                this.ErrorMessage = ex.Message;&lt;br /&gt;            }&lt;br /&gt;            CloseConnection();&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;        public void OpenDbConn()&lt;br /&gt;        {&lt;br /&gt;            try&lt;br /&gt;            {&lt;br /&gt;                //SetAppConfigData();&lt;br /&gt;                //Create_Database_IfNotExists();&lt;br /&gt;                //---Check Database exists or Not----------------&lt;br /&gt;                //---If Not exits than created automatically-----&lt;br /&gt;                //-----------------------------------------------&lt;br /&gt;                //conn = new SqlConnection(connstr);&lt;br /&gt;&lt;br /&gt;                // Changes Made By: Preeti B. Mathur&lt;br /&gt;                // Date: 07-02-2009&lt;br /&gt;                // START&lt;br /&gt;&lt;br /&gt;                string strConnectionString = EncDec.Decrypt(ConfigurationSettings.AppSettings[&quot;ConnString&quot;].ToString(), &quot;DatabaseConnectionString&quot;);&lt;br /&gt;                //conn = new SqlConnection(ConfigurationSettings.AppSettings[&quot;ConnString&quot;].ToString());&lt;br /&gt;                conn = new SqlConnection(strConnectionString);&lt;br /&gt;                // Changes Made By: Dhaval Chauhan&lt;br /&gt;                // Date: 20-02-2009&lt;br /&gt;                // START&lt;br /&gt;                //conn = new SqlConnection(connstr);&lt;br /&gt;                // END&lt;br /&gt;                conn.Open();&lt;br /&gt;                comm.Connection = conn;&lt;br /&gt;            }&lt;br /&gt;            catch &lt;br /&gt;            {&lt;br /&gt;                MessageBox.Show(&quot;Cannot connect database&quot;, &quot;Connection failed&quot;, MessageBoxButtons.OK, MessageBoxIcon.Error);&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        public bool OpenMasterDbConn()&lt;br /&gt;        {&lt;br /&gt;            bool blnRes = false;&lt;br /&gt;            try&lt;br /&gt;            {&lt;br /&gt;                SetAppConfigData();&lt;br /&gt;                strDatabase = &quot;master&quot;;&lt;br /&gt;                //Create_Database_IfNotExists();&lt;br /&gt;                //---Check Database exists or Not----------------&lt;br /&gt;                //---If Not exits than created automatically-----&lt;br /&gt;                //-----------------------------------------------&lt;br /&gt;                string connstr;&lt;br /&gt;                if (strDbAutMod == &quot;sql&quot;)&lt;br /&gt;                {&lt;br /&gt;                    connstr = &quot;Persist Security Info=False;&quot; + &quot;User ID=&quot; + strUsername + &quot;;PWD=&quot; + strPassword + &quot;;Initial Catalog=&quot; + strDatabase + &quot;;Data Source=&quot; + strServer + &quot;;&quot;;&lt;br /&gt;                }&lt;br /&gt;                else&lt;br /&gt;                {&lt;br /&gt;                    connstr = &quot;Data Source=&quot; + strServer + &quot;;Initial Catalog=&quot; + strDatabase + &quot;;Integrated Security=True&quot;;&lt;br /&gt;                }&lt;br /&gt;                // Changes Made By: Preeti B. Mathur&lt;br /&gt;                // Date: 07-02-2009&lt;br /&gt;                // START&lt;br /&gt;               // conn = new SqlConnection(ConfigurationSettings.AppSettings[&quot;ConnString&quot;].ToString());&lt;br /&gt;                conn = new SqlConnection(connstr);&lt;br /&gt;                //&quot;Persist Security Info=False;User ID=sa;PWD=sa123;Initial Catalog=master;Data Source=it-dhaval\\sqlexpress;&quot;&lt;br /&gt;                // Changes Made By: dhaval chauhan&lt;br /&gt;                // Date: 07-02-2009&lt;br /&gt;                // START&lt;br /&gt;                //conn = new SqlConnection(connstr);&lt;br /&gt;                // END&lt;br /&gt;&lt;br /&gt;                conn.Open();&lt;br /&gt;                comm.Connection = conn;&lt;br /&gt;                blnRes = true;&lt;br /&gt;            }&lt;br /&gt;            catch&lt;br /&gt;            {&lt;br /&gt;                MessageBox.Show(&quot;Cannot connect database&quot;, &quot;Connection failed&quot;, MessageBoxButtons.OK, MessageBoxIcon.Error);&lt;br /&gt;                blnRes = false;&lt;br /&gt;            }&lt;br /&gt;            return blnRes;&lt;br /&gt;        }&lt;br /&gt;        public void AddParameter(string ParamName, SqlDbType Datatype, string Value, int ParamSize)&lt;br /&gt;        {&lt;br /&gt;            SqlParameter Param = new SqlParameter(ParamName, Datatype, ParamSize);&lt;br /&gt;            Param.Value = Value;&lt;br /&gt;            Param.Direction = ParameterDirection.Input;&lt;br /&gt;            comm.Parameters.Add(Param);&lt;br /&gt;        }&lt;br /&gt;        public void AddParameter(string ParamName,SqlDbType Datatype,byte[] Value,int ParamSize)&lt;br /&gt;        {&lt;br /&gt;            SqlParameter Param = new SqlParameter(ParamName, Datatype, ParamSize);&lt;br /&gt;            Param.Value = Value;&lt;br /&gt;            Param.Direction = ParameterDirection.Input;&lt;br /&gt;            comm.Parameters.Add(Param);&lt;br /&gt;        }&lt;br /&gt;        public void AddParameter(string ParamName, SqlDbType Datatype, int Value)&lt;br /&gt;        {&lt;br /&gt;            SqlParameter Param = new SqlParameter(ParamName, Datatype);&lt;br /&gt;            Param.Value = Value;&lt;br /&gt;            Param.Direction = ParameterDirection.Input;&lt;br /&gt;            comm.Parameters.Add(Param);&lt;br /&gt;        }&lt;br /&gt;        public DataSet ExecProc(string strProcedurename,string strTablename)&lt;br /&gt;        {&lt;br /&gt;            DataSet ds = new DataSet();&lt;br /&gt;            SqlDataAdapter adp = new SqlDataAdapter();&lt;br /&gt;            OpenDbConn();&lt;br /&gt;            try&lt;br /&gt;            {&lt;br /&gt;                comm.CommandText = strProcedurename;&lt;br /&gt;                comm.CommandType = CommandType.StoredProcedure;&lt;br /&gt;                adp.SelectCommand = comm;&lt;br /&gt;                adp.Fill(ds, strTablename);&lt;br /&gt;            }&lt;br /&gt;            catch (SqlException ex)&lt;br /&gt;            {&lt;br /&gt;                this.ErrorMessage = &quot;SqlException: &quot; + ex.Message + &quot; // SqlErrorNumber:- &quot; + ex.Number;&lt;br /&gt;                string strXml = &quot;&lt;NewDataSet&gt;&lt;&quot; + strTablename + &quot;&gt;&lt;ISSUCCESS&gt;100&lt;/ISSUCCESS&gt;&lt;ERRORMESSAGE&gt;&quot; + this.ErrorMessage + &quot;&lt;/ERRORMESSAGE&gt;&lt;/&quot; + strTablename + &quot;&gt;&lt;/NewDataSet&gt;&quot;;&lt;br /&gt;                StringReader oSr = new StringReader(strXml);&lt;br /&gt;                ds.ReadXml(oSr);&lt;br /&gt;                return ds;&lt;br /&gt;            }&lt;br /&gt;            CloseConnection();&lt;br /&gt;            return ds;&lt;br /&gt;        }&lt;br /&gt;        public void CloseConnection()&lt;br /&gt;        {&lt;br /&gt;            conn.Close();&lt;br /&gt;        }&lt;br /&gt;        public DataSet ExecQry(string qry,string tablename) &lt;br /&gt;        {&lt;br /&gt;            DataSet ds = new DataSet();&lt;br /&gt;            SqlDataAdapter adp = new SqlDataAdapter();&lt;br /&gt;            try&lt;br /&gt;            {&lt;br /&gt;                OpenDbConn();&lt;br /&gt;                comm.CommandText = qry;&lt;br /&gt;                comm.CommandType = CommandType.Text;    &lt;br /&gt;                adp.SelectCommand = comm;&lt;br /&gt;                adp.Fill(ds, tablename);&lt;br /&gt;            }&lt;br /&gt;            catch (SqlException ex)&lt;br /&gt;            {&lt;br /&gt;                this.ErrorMessage = &quot;SqlException: &quot; + ex.Message + &quot; // SqlErrorNumber:- &quot; + ex.Number;&lt;br /&gt;                string strXml = &quot;&lt;NewDataSet&gt;&lt;&quot; + tablename + &quot;&gt;&lt;ISSUCCESS&gt;100&lt;/ISSUCCESS&gt;&lt;ERRORMESSAGE&gt;&quot; + this.ErrorMessage + &quot;&lt;/ERRORMESSAGE&gt;&lt;/&quot; + tablename + &quot;&gt;&lt;/NewDataSet&gt;&quot;;&lt;br /&gt;                StringReader oSr = new StringReader(strXml);&lt;br /&gt;                ds.ReadXml(oSr);&lt;br /&gt;                return ds;&lt;br /&gt;            }&lt;br /&gt;            catch (Exception ex)&lt;br /&gt;            {&lt;br /&gt;               this.ErrorMessage = ex.Message;&lt;br /&gt;            }&lt;br /&gt;            CloseConnection();&lt;br /&gt;            return ds;&lt;br /&gt;        }&lt;br /&gt;        public DataSet ExecMasterDbQry(string qry, string tablename)&lt;br /&gt;        {&lt;br /&gt;            DataSet ds = new DataSet();&lt;br /&gt;            SqlDataAdapter adp = new SqlDataAdapter();&lt;br /&gt;            try&lt;br /&gt;            {&lt;br /&gt;                OpenMasterDbConn();&lt;br /&gt;                comm.CommandText = qry;&lt;br /&gt;                comm.CommandType = CommandType.Text;&lt;br /&gt;                adp.SelectCommand = comm;&lt;br /&gt;                adp.Fill(ds, tablename);&lt;br /&gt;            }&lt;br /&gt;            catch (SqlException ex)&lt;br /&gt;            {&lt;br /&gt;                this.ErrorMessage = &quot;SqlException: &quot; + ex.Message + &quot; // SqlErrorNumber:- &quot; + ex.Number;&lt;br /&gt;                string strXml = &quot;&lt;NewDataSet&gt;&lt;&quot; + tablename + &quot;&gt;&lt;ISSUCCESS&gt;100&lt;/ISSUCCESS&gt;&lt;ERRORMESSAGE&gt;&quot; + this.ErrorMessage + &quot;&lt;/ERRORMESSAGE&gt;&lt;/&quot; + tablename + &quot;&gt;&lt;/NewDataSet&gt;&quot;;&lt;br /&gt;                StringReader oSr = new StringReader(strXml);&lt;br /&gt;                ds.ReadXml(oSr);&lt;br /&gt;                return ds;&lt;br /&gt;            }&lt;br /&gt;            catch (Exception ex)&lt;br /&gt;            {&lt;br /&gt;                this.ErrorMessage = ex.Message;&lt;br /&gt;            }&lt;br /&gt;            CloseConnection();&lt;br /&gt;            return ds;&lt;br /&gt;        }&lt;br /&gt;      &lt;br /&gt;    }&lt;br /&gt;}</content><link rel='replies' type='application/atom+xml' href='http://dhavaldchauhan.blogspot.com/feeds/2012008456170809696/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5272785075638971360/2012008456170809696?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/2012008456170809696'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/2012008456170809696'/><link rel='alternate' type='text/html' href='http://dhavaldchauhan.blogspot.com/2009/06/database-connection-class.html' title='Database connection Class'/><author><name>Dhaval Chauhan</name><uri>http://www.blogger.com/profile/09825343181598773305</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIy30CFXmSnfDgARcOeX5neh8pDl4zf1mlZBUFsolr8Ikyws1Xlvf-1n8mJAZIX8AngQE5IWG91OV1xc9mjvL-VXEhV6TuBleFg-w8UoRCihX8OOD_6q58jTPiCdSr/s220/MyPhoto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5272785075638971360.post-2563116267851281839</id><published>2008-11-26T10:09:00.003+05:30</published><updated>2008-11-26T10:14:26.704+05:30</updated><title type='text'>Save And Retrive Any format file to database</title><content type='html'>//--Data base table required sql server-2005&lt;br /&gt;column 1.Id(Pk)&lt;br /&gt;       2.FileName(nvarchar(max))&lt;br /&gt;       3.FileData(varbinary(max))&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;private void SaveFile()&lt;br /&gt;        {&lt;br /&gt;            try&lt;br /&gt;            {&lt;br /&gt;                if (txtFile .Text  != &quot;&quot;)&lt;br /&gt;                {&lt;br /&gt;                    FileStream fs;&lt;br /&gt;                    fs = new FileStream(txtFile.Text, FileMode.OpenOrCreate, FileAccess.ReadWrite);&lt;br /&gt;                    BinaryReader br;&lt;br /&gt;                    br=new BinaryReader(fs);&lt;br /&gt;                    ////a byte array to read the image&lt;br /&gt;                    byte[] picbyte = br.ReadBytes ((int)fs.Length);&lt;br /&gt;                    //byte[] picbyte = new byte[fs.Length];&lt;br /&gt;                   // br.Close();&lt;br /&gt;                    fs.Close();&lt;br /&gt;                    //open the database using odp.net and insert the data&lt;br /&gt;                    string connstr = &quot;Data Source=IT-DHAVAL\\SQLEXPRESS;Initial Catalog=treeview;User ID=sa;PWD=sa123&quot;;&lt;br /&gt;                    SqlConnection conn = new SqlConnection(connstr);&lt;br /&gt;                    conn.Open();&lt;br /&gt;                    string query;&lt;br /&gt;                    SqlParameter Fileparameter = new SqlParameter();&lt;br /&gt;                    query = &quot;insert into files(FileName,FileData) values(&#39;&quot; +txtFile.Text + &quot;&#39;,&quot;+&quot;@pic)&quot;;&lt;br /&gt;                    SqlCommand cmd = new SqlCommand(query, conn);&lt;br /&gt;                    cmd.Parameters.Add(&quot;pic&quot;,SqlDbType.VarBinary,picbyte.Length).Value=picbyte;&lt;br /&gt;                    cmd.ExecuteNonQuery();&lt;br /&gt;                    MessageBox.Show(&quot;FileSave&quot;);&lt;br /&gt;                    cmd.Dispose();&lt;br /&gt;                    conn.Close();&lt;br /&gt;                    conn.Dispose();&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;            catch (Exception ex)&lt;br /&gt;            {&lt;br /&gt;                MessageBox.Show(ex.Message);&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        private void btnRetrive_Click(object sender, EventArgs e)&lt;br /&gt;        {&lt;br /&gt;            string connstr = &quot;Data Source=IT-DHAVAL\\SQLEXPRESS;Initial Catalog=treeview;User ID=sa;PWD=sa123&quot;;&lt;br /&gt;            SqlConnection conn = new SqlConnection(connstr);&lt;br /&gt;            conn.Open();&lt;br /&gt;            SqlDataAdapter empadap1 = new SqlDataAdapter();&lt;br /&gt;            empadap1.SelectCommand = new SqlCommand(&quot;SELECT * FROM files&quot;, conn);&lt;br /&gt;            DataSet dset = new DataSet(&quot;dset&quot;);&lt;br /&gt;            empadap1.Fill(dset);&lt;br /&gt;            DataTable dtable;&lt;br /&gt;            dtable = dset.Tables[0];&lt;br /&gt;            DataTable dataTable = dset.Tables[0];&lt;br /&gt;            foreach (DataRow dataRow in dataTable.Rows)&lt;br /&gt;            {&lt;br /&gt;                FileStream FS1 = new FileStream(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + &quot;\\&quot; + (string)dataRow[1], FileMode.Create);&lt;br /&gt;                byte[] blob = (byte[])dataRow[2];&lt;br /&gt;                FS1.Write(blob, 0, blob.Length);&lt;br /&gt;                FS1.Close();&lt;br /&gt;                FS1 = null;&lt;br /&gt;            }&lt;br /&gt;        }</content><link rel='replies' type='application/atom+xml' href='http://dhavaldchauhan.blogspot.com/feeds/2563116267851281839/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5272785075638971360/2563116267851281839?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/2563116267851281839'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/2563116267851281839'/><link rel='alternate' type='text/html' href='http://dhavaldchauhan.blogspot.com/2008/11/save-and-retrive-any-format-file-to.html' title='Save And Retrive Any format file to database'/><author><name>Dhaval Chauhan</name><uri>http://www.blogger.com/profile/09825343181598773305</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIy30CFXmSnfDgARcOeX5neh8pDl4zf1mlZBUFsolr8Ikyws1Xlvf-1n8mJAZIX8AngQE5IWG91OV1xc9mjvL-VXEhV6TuBleFg-w8UoRCihX8OOD_6q58jTPiCdSr/s220/MyPhoto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5272785075638971360.post-4959633961390404579</id><published>2008-10-23T11:23:00.001+05:30</published><updated>2008-10-23T11:26:55.843+05:30</updated><title type='text'>Tab based MDI from</title><content type='html'>When the MDI Child Form is activated; if child form has a tab page, activate the corresponding tab page else create a tab page for child form and select tab page.&lt;br /&gt;&lt;br /&gt;private void Form1_MdiChildActivate(object sender, &lt;br /&gt;                                    EventArgs e) &lt;br /&gt;{ &lt;br /&gt;    if (this.ActiveMdiChild == null) &lt;br /&gt;        tabForms.Visible = false; &lt;br /&gt;        // If no any child form, hide tabControl &lt;br /&gt;&lt;br /&gt;    else &lt;br /&gt;    { &lt;br /&gt;        this.ActiveMdiChild.WindowState = &lt;br /&gt;        FormWindowState.Maximized; &lt;br /&gt;        // Child form always maximized &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        // If child form is new and no has tabPage, &lt;br /&gt;&lt;br /&gt;        // create new tabPage &lt;br /&gt;&lt;br /&gt;        if (this.ActiveMdiChild.Tag == null) &lt;br /&gt;        { &lt;br /&gt;            // Add a tabPage to tabControl with child &lt;br /&gt;&lt;br /&gt;            // form caption &lt;br /&gt;&lt;br /&gt;            TabPage tp = new TabPage(this.ActiveMdiChild&lt;br /&gt;                                     .Text); &lt;br /&gt;            tp.Tag = this.ActiveMdiChild; &lt;br /&gt;            tp.Parent = tabForms; &lt;br /&gt;            tabForms.SelectedTab = tp;&lt;br /&gt;            &lt;br /&gt;            this.ActiveMdiChild.Tag = tp; &lt;br /&gt;            this.ActiveMdiChild.FormClosed += &lt;br /&gt;                new FormClosedEventHandler(&lt;br /&gt;                                ActiveMdiChild_FormClosed); &lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        if (!tabForms.Visible) tabForms.Visible = true;&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;When the MDI Child Form is closing, destroy the corresponding tab page. Add the following code to main form.&lt;br /&gt;&lt;br /&gt;private void ActiveMdiChild_FormClosed(object sender, &lt;br /&gt;                                    FormClosedEventArgs e)&lt;br /&gt;{&lt;br /&gt;    ((sender as Form).Tag as TabPage).Dispose(); &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;When a tab page selected, activate its child form &lt;br /&gt;&lt;br /&gt;private void tabForms_SelectedIndexChanged(object sender, &lt;br /&gt;                                           EventArgs e) &lt;br /&gt;{ &lt;br /&gt;    if ((tabForms.SelectedTab != null) &amp;&amp; &lt;br /&gt;        (tabForms.SelectedTab.Tag != null)) &lt;br /&gt;        (tabForms.SelectedTab.Tag as Form).Select(); &lt;br /&gt;}</content><link rel='replies' type='application/atom+xml' href='http://dhavaldchauhan.blogspot.com/feeds/4959633961390404579/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5272785075638971360/4959633961390404579?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/4959633961390404579'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/4959633961390404579'/><link rel='alternate' type='text/html' href='http://dhavaldchauhan.blogspot.com/2008/10/tab-based-mdi-from.html' title='Tab based MDI from'/><author><name>Dhaval Chauhan</name><uri>http://www.blogger.com/profile/09825343181598773305</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIy30CFXmSnfDgARcOeX5neh8pDl4zf1mlZBUFsolr8Ikyws1Xlvf-1n8mJAZIX8AngQE5IWG91OV1xc9mjvL-VXEhV6TuBleFg-w8UoRCihX8OOD_6q58jTPiCdSr/s220/MyPhoto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5272785075638971360.post-8830106096107782397</id><published>2008-09-02T14:51:00.000+05:30</published><updated>2008-09-02T15:37:45.167+05:30</updated><title type='text'>Ajax Class</title><content type='html'>//var //xmlHttp = //createXmlHttpRequestObject();&lt;br /&gt;//    function //createXmlHttpRequestObject()&lt;br /&gt; //   {&lt;br /&gt;  //      try&lt;br /&gt;   //     {&lt;br /&gt;     //       // try to create XMLHttpRequest object&lt;br /&gt;      //      //xmlHttp = new //XMLHttpRequest();&lt;br /&gt;       // }&lt;br /&gt;        //catch(e)&lt;br /&gt;        //{&lt;br /&gt;         //   var //XmlHttpVersions = new //Array(&quot;MSXML2.XMLHTTP.6.0&quot;,&quot;MSXML2.XMLHTTP.5.0&quot;,      //&quot;MSXML2.XMLHTTP.4.0&quot;,&quot;MSXML2.XMLHTTP.3.0&quot;,&quot;MSXML2.XMLHTTP&quot;,&quot;Microsoft.XMLHTTP&quot;);&lt;br /&gt;  //          for (var i=0; i&lt;//XmlHttpVersions.length &amp;amp;&amp;amp; !xmlHttp; i++)&lt;br /&gt;    //        {&lt;br /&gt;      //      try&lt;br /&gt;        //        {&lt;br /&gt;          //     // xmlHttp = new //ActiveXObject(//XmlHttpVersions[i]);&lt;br /&gt;            //    }&lt;br /&gt;            //catch (e)&lt;br /&gt;            //    {}&lt;br /&gt;            //}&lt;br /&gt;        //}&lt;br /&gt;        //if (!//xmlHttp)&lt;br /&gt;         //   alert(&quot;Error creating the //XMLHttpRequest object.&quot;);&lt;br /&gt;        //else&lt;br /&gt;        //return //xmlHttp;&lt;br /&gt;    //}&lt;br /&gt;//Pass Your Data in below function&lt;br /&gt;//Url is Url of your Ajax Pages&lt;br /&gt;//TimerFunction function name for if serverbusy then which function called e.g:test()&lt;br /&gt;//TimerDelay is delay calll timer&lt;br /&gt;//Wait Function in server busy mode which image call or text display&lt;br /&gt;    //here pass only function name like test not test().and in this funtion put status argument  value off and value  on&lt;br /&gt;//RequestFor= type charcter which u want which user in AjaxResponse() funtion as per your value call ServerResponse Funtion that will return xmlRootnode&lt;br /&gt;//Now put One Funtion name as exactly=AjaxResponse(RequestFor)&lt;br /&gt;    //function AjaxRequest(Url,TimerFunction,TimeDelay,WaitFunction,RequestFor)&lt;br /&gt;    //{&lt;br /&gt;      //  if(//xmlHttp)&lt;br /&gt;        //{&lt;br /&gt;          //  try&lt;br /&gt;            //{&lt;br /&gt;             //   if((//xmlHttp.readyState==0)||(//xmlHttp.readyState==4))&lt;br /&gt;               // {       &lt;br /&gt;                //    try&lt;br /&gt;                  //  {&lt;br /&gt;                   //     //xmlHttp.open(&quot;GET&quot;, Url, true);&lt;br /&gt;                    //}&lt;br /&gt;       //             catch(e)&lt;br /&gt;        //            {&lt;br /&gt;         //               alert(&quot;File not found&quot;+e);&lt;br /&gt;          //          }&lt;br /&gt;           //         // state Change Function&lt;br /&gt;           //         //xmlHttp.onreadystatechange=&lt;br /&gt;            //        function AjaxStateChange()&lt;br /&gt;             //       {&lt;br /&gt;          //              if(//xmlHttp.readyState==1 ||//xmlHttp.readyState==3 || //xmlHttp.readyState==2)&lt;br /&gt;  //                      {&lt;br /&gt;    //                    //If server busy then wait message comes in picture with //body disabled&lt;br /&gt;  //                      setTimeout(&quot;&quot;+WaitFunction+&quot;(&#39;on&#39;)&quot;+&quot;&quot;,0);&lt;br /&gt;    //                    }&lt;br /&gt;      //                  else if (//xmlHttp.readyState == 4)&lt;br /&gt;        //                {&lt;br /&gt;          //                  setTimeout(&quot;&quot;+WaitFunction+&quot;(&#39;off&#39;)&quot;+&quot;&quot;,0);&lt;br /&gt;                            //Now Server not busy and ready with output&lt;br /&gt;         //                   if (//xmlHttp.status == 200)&lt;br /&gt;          //                  {&lt;br /&gt;           //                     try&lt;br /&gt;             //                   {&lt;br /&gt;                                //Server Response Funtion&lt;br /&gt;              //                  //AjaxResponse(RequestFor);&lt;br /&gt;                //                }&lt;br /&gt;                 //               catch(e)&lt;br /&gt;                  //              {&lt;br /&gt;                   //                 alert(&quot;Error reading the response: &quot; + //e.toString());&lt;br /&gt;  //                              }&lt;br /&gt;    //                        }&lt;br /&gt;      //                      else&lt;br /&gt;        //                    {&lt;br /&gt;          //                      alert(&quot;There was a problem retrieving the data:\n&quot; //+//xmlHttp.statusText);&lt;br /&gt;  //                          }&lt;br /&gt;    //                    }&lt;br /&gt;      //              }&lt;br /&gt;       //             //----------------&lt;br /&gt;         //           //xmlHttp.send(null);&lt;br /&gt;           //     }&lt;br /&gt;  //              else&lt;br /&gt;    //            {&lt;br /&gt;     //               setTimeout(&quot;&quot;+TimerFunction+&quot;&quot;,TimeDelay);&lt;br /&gt;      //          }   &lt;br /&gt;       //     }&lt;br /&gt;        //    catch (e)&lt;br /&gt;         //   {&lt;br /&gt;          //      alert(&quot;Can&#39;t connect to server:\n&quot; + e.toString());&lt;br /&gt;           // }&lt;br /&gt;        //}&lt;br /&gt;        //return false;&lt;br /&gt;//    }&lt;br /&gt;  //  function AjaxResponse(RequestFor)&lt;br /&gt;    //{&lt;br /&gt;     //   var //xmlResponse = //xmlHttp.responseXML;&lt;br /&gt;&lt;br /&gt;      //  if (//!xmlResponse || //!xmlResponse.documentElement)&lt;br /&gt;       // throw(&quot;Invalid XML structure:\n&quot; + //xmlHttp.responseText);&lt;br /&gt;        //var rootNodeName = ///xmlResponse.documentElement.nodeName;&lt;br /&gt;        //if (rootNodeName == &quot;parsererror&quot;)&lt;br /&gt;       // throw(&quot;Invalid XML structure&quot;);&lt;br /&gt;       // //xmlRoot = xmlResponse.documentElement;&lt;br /&gt;        //GetResponse(//xmlRoot,RequestFor);&lt;br /&gt;    //}&lt;br /&gt;    //function GetResponse(Root,RequestFor)&lt;br /&gt;    //{&lt;br /&gt;     //   if(RequestFor==&#39;ValueToMatch&#39;)&lt;br /&gt;      //  {&lt;br /&gt;       //     ServerResponseFunction1(Root);&lt;br /&gt;        //}&lt;br /&gt;        //else if(RequestFor==&#39;ValueToMatch&#39;)&lt;br /&gt;        //{&lt;br /&gt;         //   ServerResponseFunction2(Root);&lt;br /&gt;        //}&lt;br /&gt;       &lt;br /&gt;    //}</content><link rel='replies' type='application/atom+xml' href='http://dhavaldchauhan.blogspot.com/feeds/8830106096107782397/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5272785075638971360/8830106096107782397?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/8830106096107782397'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/8830106096107782397'/><link rel='alternate' type='text/html' href='http://dhavaldchauhan.blogspot.com/2008/09/ajax-class.html' title='Ajax Class'/><author><name>Dhaval Chauhan</name><uri>http://www.blogger.com/profile/09825343181598773305</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIy30CFXmSnfDgARcOeX5neh8pDl4zf1mlZBUFsolr8Ikyws1Xlvf-1n8mJAZIX8AngQE5IWG91OV1xc9mjvL-VXEhV6TuBleFg-w8UoRCihX8OOD_6q58jTPiCdSr/s220/MyPhoto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5272785075638971360.post-2824558158411106188</id><published>2008-08-14T08:54:00.000+05:30</published><updated>2008-08-14T08:56:48.520+05:30</updated><title type='text'>PHP_IMAGE_FROM_DATABASE</title><content type='html'>To Upload DataBase:&lt;br /&gt;$filename=$_FILES[&#39;imgfile&#39;][&#39;name&#39;];&lt;br /&gt;    $img=&quot;C:\\PHP\\uploadtemp\\&quot;.$_FILES[&#39;imgfile&#39;][&#39;name&#39;];&lt;br /&gt;    &lt;br /&gt;  #&lt;br /&gt;$fh = fopen($_FILES[&#39;imgfile&#39;][&#39;tmp_name&#39;], &quot;rb&quot;);&lt;br /&gt;#&lt;br /&gt;$imgdata = addslashes(fread($fh, filesize($_FILES[&#39;imgfile&#39;][&#39;tmp_name&#39;])));&lt;br /&gt;#&lt;br /&gt;fclose($fh);&lt;br /&gt;$imgdata store to database as variable&lt;br /&gt;Retrive Image Form Database:&lt;br /&gt;&lt;?php&lt;br /&gt;      $UserId=$_REQUEST[&#39;get&#39;];&lt;br /&gt;    //$UserId=1;   &lt;br /&gt;     $dbconn = mysql_connect(&#39;localhost&#39;,&#39;root&#39;,&#39;admin&#39;) or exit(&quot;SERVER Unavailable&quot;);&lt;br /&gt;       $db=mysql_select_db(&#39;test&#39;,$dbconn) or exit(&quot;DB Unavailable&quot;);&lt;br /&gt;     $query = &quot;SELECT Image FROM UserLogin where UserId=$UserId&quot;;&lt;br /&gt;     $result = mysql_query($query, $dbconn) or die(&#39;Check Sql Statement&#39;);&lt;br /&gt;     $result_data = mysql_fetch_array($result, MYSQL_ASSOC);&lt;br /&gt;     $img=$result_data[&#39;Image&#39;];&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;if (!empty($img))&lt;br /&gt;{&lt;br /&gt;    header(&quot;Content-Type: image/jpeg&quot;);&lt;br /&gt;    $img=$result_data[&#39;Image&#39;];&lt;br /&gt;    echo $img;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;    $imgfile=&quot;../Image/NotFound.jpg&quot;;   &lt;br /&gt;    $img=imagecreatefromjpeg($imgfile);&lt;br /&gt;    header(&quot;Content-Type: image/jpeg&quot;);&lt;br /&gt;    imagejpeg($img);&lt;br /&gt;}&lt;br /&gt;exit();&lt;br /&gt;?&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhavaldchauhan.blogspot.com/feeds/2824558158411106188/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5272785075638971360/2824558158411106188?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/2824558158411106188'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/2824558158411106188'/><link rel='alternate' type='text/html' href='http://dhavaldchauhan.blogspot.com/2008/08/phpimagefromdatabase.html' title='PHP_IMAGE_FROM_DATABASE'/><author><name>Dhaval Chauhan</name><uri>http://www.blogger.com/profile/09825343181598773305</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIy30CFXmSnfDgARcOeX5neh8pDl4zf1mlZBUFsolr8Ikyws1Xlvf-1n8mJAZIX8AngQE5IWG91OV1xc9mjvL-VXEhV6TuBleFg-w8UoRCihX8OOD_6q58jTPiCdSr/s220/MyPhoto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5272785075638971360.post-5571302512034945753</id><published>2008-08-02T08:34:00.000+05:30</published><updated>2008-08-02T08:40:17.206+05:30</updated><title type='text'>Javascript for Work WIth Ajax</title><content type='html'>// JavaScript Document&lt;br /&gt;//var xmlHttp = //createXmlHttpRequestObject();&lt;br /&gt; &lt;br /&gt; //IF Page Submit/Postback&lt;br /&gt; TimerId=0;&lt;br /&gt; TimerId=setTimeout(&#39;GetPastDtl(document.getElementById(&quot;CompList&quot;).value)&#39;,1000);&lt;br /&gt; function createXmlHttpRequestObject()&lt;br /&gt; {&lt;br /&gt;  try&lt;br /&gt;  {&lt;br /&gt;   // try to create XMLHttpRequest object&lt;br /&gt;   //xmlHttp = new //XMLHttpRequest();&lt;br /&gt;  }&lt;br /&gt;  catch(e)&lt;br /&gt;  {&lt;br /&gt;   var //XmlHttpVersions = new Array(&quot;MSXML2.XMLHTTP.6.0&quot;,&quot;MSXML2.XMLHTTP.5.0&quot;,   &quot;MSXML2.XMLHTTP.4.0&quot;,&quot;MSXML2.XMLHTTP.3.0&quot;,&quot;MSXML2.XMLHTTP&quot;,&quot;Microsoft.XMLHTTP&quot;);&lt;br /&gt;   //for (var i=0; i&lt;!--/XmlHttpVersions.length &amp;&amp; !//xmlHttp; i++)    {    try     {     //xmlHttp = new ActiveXObject(XmlHttpVersions[i]);     }    catch (e)        {}    }   }   if (//!xmlHttp)    alert(&quot;Error creating the// XMLHttpRequest object.&quot;);   else   return //xmlHttp;  }  function GetPastDtl(val)  {  GetEmpDetail();  } function EmpDtlRequestStateChange()  {   if(//xmlHttp.readyState==1 || //xmlHttp.readyState==3 || //xmlHttp.readyState==2)   {     //If server busy then wait message comes in picture with body disabled     document.getElementById(&#39;trWait&#39;).style.display=&quot;&quot;;     document.getElementById(&#39;body&#39;).style.disabled=true;   }   else if (//xmlHttp.readyState == 4)   {    //Now Server not busy and ready with output document.getElementById(&#39;body&#39;).style.disabled=false; document.getElementById(&#39;trWait&#39;).style.display=&quot;none&quot;;    if (//xmlHttp.status == 200)    {    try    {     //Server Response Funtion     EmpDtlServerResponse();    }    catch(e)    {     alert(&quot;Error reading the response: &quot; + e.toString());    }    }    else    {     alert(&quot;There was a problem retrieving the data:\n&quot; +xmlHttp.statusText);    }   }  }  function EmpDtlServerResponse()  {   var xmlResponse = //xmlHttp.responseXML;   if (//!xmlResponse || //!xmlResponse.documentElement)   throw(&quot;Invalid XML structure:\n&quot; + xmlHttp.responseText);   var rootNodeName = xmlResponse.documentElement.nodeName;   if (rootNodeName == &quot;parsererror&quot;)    throw(&quot;Invalid XML structure&quot;);   //xmlRoot = //xmlResponse.documentElement;   if(document.getElementById(&#39;CompList&#39;).value!=-1)   {            //For Total Row     //TotalRow=//xmlRoot.getElementsByTagName(&quot;rowcount&quot;);    //TotalRowCount=TotalRow.item(0).firstChild.data;    //document.getElementById(&#39;hdnTotalRow&#39;).value=TotalRowCount;   //For Total Page    //TotalPage=xmlRoot.getElementsByTagName(&quot;PageCount&quot;);    //TotalPageCount=TotalPage.item(0).firstChild.data;    //document.getElementById(&#39;hdnTotalPage&#39;).value=TotalPageCount;   }   //ForDepartment    dvalueArray = xmlRoot.getElementsByTagName(&quot;dvalue&quot;);    dtextArray = xmlRoot.getElementsByTagName(&quot;dtext&quot;);    olddept=document.getElementById(&#39;DeptList&#39;).value;    document.getElementById(&#39;DeptList&#39;).innerHTML=&quot;&quot;;    k=document.createElement(&quot;option&quot;,&quot;&quot;);    k.value=&quot;-1&quot;;    k.text=&quot;&lt;-All--&gt;&quot;;&lt;br /&gt;   document.getElementById(&#39;DeptList&#39;).options.add(k);&lt;br /&gt;   for (var i=0; i&lt;dvaluearray.length; var=&quot;&quot; j=&quot;document.createElement(&amp;quot;option&amp;quot;,&amp;quot;&amp;quot;);&quot; data=&quot;=olddept)&quot; selected=&quot;true;}&quot; deptlist=&quot;&quot; foremployee=&quot;&quot; evaluearray=&quot;xmlRoot.getElementsByTagName(&amp;quot;evalue&amp;quot;);&quot; etextarray=&quot;xmlRoot.getElementsByTagName(&amp;quot;etext&amp;quot;);&quot; oldemp=&quot;document.getElementById(&#39;EmpList&#39;).value;&quot; emplist=&quot;&quot; innerhtml=&quot;&quot; l=&quot;document.createElement(&amp;quot;option&amp;quot;,&amp;quot;&amp;quot;);&quot; value=&quot;dvalueArray.item(i).firstChild.data;&quot; text=&quot;dtextArray.item(i).firstChild.data;&quot;&gt;&lt;br /&gt;   document.getElementById(&#39;EmpList&#39;).options.add(l);&lt;br /&gt;   for (var m=0; m&lt;evaluearray.length; var=&quot;&quot; n=&quot;document.createElement(&amp;quot;option&amp;quot;,&amp;quot;&amp;quot;);&quot; value=&quot;evalueArray.item(m).firstChild.data;&quot; text=&quot;etextArray.item(m).firstChild.data;&quot; data=&quot;=oldEmp)&quot; selected=&quot;true;}&quot; emplist=&quot;&quot; for=&quot;&quot; datatable=&quot;&quot; to=&quot;&quot; keep=&quot;&quot; row=&quot;&quot; edit=&quot;&quot; mode=&quot;&quot; username=&quot;&quot; already=&quot;&quot; exits=&quot;&quot; in=&quot;&quot; database=&quot;&quot; updatearray=&quot;xmlRoot.getElementsByTagName(&amp;quot;UpdateError&amp;quot;);&quot; if=&quot;&quot; length=&quot;&quot;&gt;0)&lt;br /&gt;   {&lt;br /&gt;    i=document.getElementById(&#39;EditedRowNo&#39;).value;&lt;br /&gt;    GetEditMode(&#39;divEd&#39;+i,&#39;divRd&#39;+i,&#39;divNameEd&#39;+i,&#39;divNameRd&#39;+i,&#39;divMailEd&#39;+i,&#39;divMailRd&#39;+i,ENameDtlArray.length); &lt;br /&gt;   }&lt;br /&gt;  &lt;br /&gt; }&lt;br /&gt; function GetEmpDetail()&lt;br /&gt; {&lt;br /&gt;  CompId=document.getElementById(&#39;CompList&#39;).value;&lt;br /&gt;  DeptId=document.getElementById(&#39;DeptList&#39;).value;&lt;br /&gt;  EmpId=document.getElementById(&#39;EmpList&#39;).value;&lt;br /&gt;  PageSize=document.getElementById(&#39;hdnPageSize&#39;).value;&lt;br /&gt;  Offset=document.getElementById(&#39;hdnoffset&#39;).value;&lt;br /&gt;  CurrnentPg=document.getElementById(&#39;hdnCurrPg&#39;).value;&lt;br /&gt;  TotalPg=document.getElementById(&#39;hdnTotalRow&#39;).value;&lt;br /&gt;  if (xmlHttp)&lt;br /&gt;  {&lt;br /&gt;  try&lt;br /&gt;  {&lt;br /&gt;  if((xmlHttp.readyState==0)||(xmlHttp.readyState==4))&lt;br /&gt;   {       &lt;br /&gt;  var params = &quot;CompId=&quot; + CompId+&quot;&amp;amp;DeptId=&quot;+DeptId+&quot;&amp;amp;EmpId=&quot;+EmpId+&quot;&amp;amp;PageSize=&quot;+PageSize+&quot;&amp;amp;Offset=&quot;+Offset;&lt;br /&gt;   //xmlHttp.open(&quot;GET&quot;, &quot;Xml/EmpToDetail.php?&quot; + params, true);&lt;br /&gt;   //xmlHttp.onreadystatechange = EmpDtlRequestStateChange;&lt;br /&gt;   //xmlHttp.send(null);&lt;br /&gt;   }&lt;br /&gt;   else&lt;br /&gt;   {&lt;br /&gt;    setTimeout(&#39;GetEmpDetail()&#39;,1000);&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt;  catch (e)&lt;br /&gt;  {&lt;br /&gt;   alert(&quot;Can&#39;t connect to server:\n&quot; + e.toString());&lt;br /&gt;  }&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt; function CreateTd(id,style,className,innerHTML)&lt;br /&gt; {&lt;br /&gt;  Td=document.createElement(&quot;td&quot;,&quot;&quot;);&lt;br /&gt;  Td.setAttribute(&quot;id&quot;,id);&lt;br /&gt;  Td.setAttribute(&quot;style&quot;,style);&lt;br /&gt;  Td.className=className;&lt;br /&gt;  Td.innerHTML=innerHTML;&lt;br /&gt;  return Td;&lt;br /&gt; }&lt;br /&gt; function CreateTextBox(AttributeArray,ValueArray,Value)&lt;br /&gt; {&lt;br /&gt;  inputName=document.createElement(&quot;input&quot;,&quot;&quot;);&lt;br /&gt;  for(i=0;i&lt;=AttributeArray.length-1;i++)   {    inputName.setAttribute(AttributeArray[i],ValueArray[i]);   }   inputName.value=Value;   return inputName;  }  function GridTable()  {    document.getElementById(&quot;EmpDetail&quot;).innerHTML=&quot;&quot;;    div=document.getElementById(&quot;EmpDetail&quot;);    //Generate Table    Table=document.createElement(&quot;table&quot;,&quot;&quot;);    Table.setAttribute(&quot;style&quot;,&quot;width:100%&quot;);    Table.setAttribute(&quot;cellpadding&quot;,&quot;0&quot;);    Table.setAttribute(&quot;cellspacing&quot;,&quot;0&quot;);    Table.setAttribute(&quot;border&quot;,&quot;1&quot;);    //Generate Row    Tr=document.createElement(&quot;tr&quot;,&quot;&quot;);    //Generate Column1    Td1=CreateTd(&#39;&#39;,&#39;width:40%&#39;,&#39;TdDataHeading&#39;,&#39;Name&#39;);    Tr.appendChild(Td1);    //Generate Column2    Td2=CreateTd(&#39;&#39;,&#39;width:40%&#39;,&#39;TdDataHeading&#39;,&#39;Email&#39;);    Tr.appendChild(Td2);    //Generate Coloumn3    Td3=CreateTd(&#39;&#39;,&#39;width:20%&#39;,&#39;TdDataHeading&#39;,&#39;Manage&#39;);    Tr.appendChild(Td3);    Table.appendChild(Tr);    ENameDtlArray = xmlRoot.getElementsByTagName(&quot;Ename&quot;);    EmailDtlArray = xmlRoot.getElementsByTagName(&quot;Email&quot;);    EContactIdArray=xmlRoot.getElementsByTagName(&quot;EContactId&quot;);    for (var i=0; i&lt;enamedtlarray.length; mail=&quot;EmailDtlArray.item(i).firstChild.data;&quot; tr=&quot;document.createElement(&amp;quot;tr&amp;quot;,&amp;quot;&amp;quot;);&quot; generate=&quot;&quot; column1=&quot;&quot; td1=&quot;CreateTd(&#39;&#39;,&#39;width:40%&#39;,&#39;TdData&#39;,&#39;&#39;);&quot; contactid=&quot;EContactIdArray.item(i).firstChild.data;&quot; feild=&quot;&quot; type=&quot;&quot; hidden=&quot;&quot; value=&quot;ContactId;&quot; innerhtml=&quot;Name;&quot; divnameed=&quot;document.createElement(&amp;quot;div&amp;quot;,&amp;quot;&amp;quot;);&quot; none=&quot;&quot; edit=&quot;&quot; inputname=&quot;CreateTextBox([&#39;type&#39;,&#39;name&#39;,&#39;id&#39;],[&#39;text&#39;,&#39;text&#39;+i,&#39;text&#39;+i],Name);&quot; name=&quot;ENameDtlArray.item(i).firstChild.data;&quot; availability=&quot;&quot; on=&quot;&quot; textbox=&quot;&quot; cursor=&quot;&quot; remove=&quot;&quot; below=&quot;&quot; comment=&quot;&quot; onblur=&quot;&quot; return=&quot;&quot; hdnconid=&quot;document.createElement(&#39;input&#39;,&#39;&#39;);&quot; text=&quot;&quot; divnamerd=&quot;document.createElement(&amp;quot;div&amp;quot;,&amp;quot;&amp;quot;);&quot; textmail=&quot;&quot; divmailrd=&quot;&quot; forupdate=&quot;&quot; error=&quot;&quot; updatearray=&quot;xmlRoot.getElementsByTagName(&amp;quot;UpdateError&amp;quot;);&quot; updatingarray=&quot;xmlRoot.getElementsByTagName(&amp;quot;UpdatingName&amp;quot;);&quot; id=&quot;&quot; diverr=&quot;&quot; style=&quot;&quot; 10px=&quot;&quot; if=&quot;&quot; length=&quot;&quot;&gt;0)&amp;amp;&amp;amp;(i==document.getElementById(&#39;EditedRowNo&#39;).value))&lt;br /&gt;    {&lt;br /&gt;     UpdateErrMsg=UpdateArray.item(0).firstChild.data;&lt;br /&gt;     divErr.innerHTML=UpdateErrMsg;&lt;br /&gt;    }&lt;br /&gt;    Td1.appendChild(divErr);&lt;br /&gt;    Tr.appendChild(Td1);&lt;br /&gt;    //Generate Column2&lt;br /&gt;    Td2=CreateTd(&#39;&#39;,&#39;width:40%&#39;,&#39;TdData&#39;,&#39;&#39;);&lt;br /&gt;    divMailRd=document.createElement(&quot;div&quot;,&quot;&quot;);&lt;br /&gt;    divMailRd.setAttribute(&#39;id&#39;,&#39;divMailRd&#39;+i);&lt;br /&gt;    divMailRd.innerHTML=mail;&lt;br /&gt;    Td2.appendChild(divMailRd);&lt;br /&gt;    divMailEd=document.createElement(&quot;div&quot;,&quot;&quot;);&lt;br /&gt;    divMailEd.setAttribute(&#39;id&#39;,&#39;divMailEd&#39;+i);&lt;br /&gt;    divMailEd.setAttribute(&#39;style&#39;,&#39;display:none&#39;);&lt;br /&gt;    //Edit Text&lt;br /&gt;    inputMail=CreateTextBox([&#39;type&#39;,&#39;name&#39;,&#39;id&#39;],[&#39;text&#39;,&#39;textmail&#39;+i,&#39;textmail&#39;+i],mail);&lt;br /&gt;    divMailEd.appendChild(inputMail)&lt;br /&gt;    //--&lt;br /&gt;    Td2.appendChild(divMailEd);&lt;br /&gt;    Tr.appendChild(Td2);&lt;br /&gt;    //Generate Column3&lt;br /&gt;    Td3=CreateTd(&#39;&#39;,&#39;width:20%&#39;,&#39;TdData&#39;,&#39;&#39;);&lt;br /&gt;    //Div for Readmode Link&lt;br /&gt;    DivRd=document.createElement(&quot;div&quot;,&quot;&quot;);&lt;br /&gt;    DivRd.setAttribute(&quot;id&quot;,&quot;divRd&quot;+i);&lt;br /&gt;    EditLink=document.createElement(&quot;a&quot;,&quot;&quot;);&lt;br /&gt;    EditLink.setAttribute(&quot;href&quot;,&quot;Javascript&quot;);&lt;br /&gt;    EditLink.setAttribute(&quot;onClick&quot;,&lt;br /&gt;           &quot;return GetEditMode(&#39;divEd&quot;+i+&quot;&#39;,&#39;divRd&quot;+i+&quot;&#39;,&#39;divNameEd&quot;+i+&quot;&#39;,&#39;divNameRd&quot;+i+&quot;&#39;,&#39;divMailEd&quot;+i+&quot;&#39;,&#39;divMailRd&quot;+i+&quot;&#39;,ENameDtlArray.length);&quot;);&lt;br /&gt;    EditLink.innerHTML=&quot;Edit&quot;;&lt;br /&gt;    DivRd.appendChild(EditLink);&lt;br /&gt;    Td3.appendChild(DivRd);&lt;br /&gt;    //-------&lt;br /&gt;    //Div for Editmode Link&lt;br /&gt;    DivEd=document.createElement(&quot;div&quot;,&quot;&quot;);&lt;br /&gt;    DivEd.setAttribute(&quot;id&quot;,&quot;divEd&quot;+i);&lt;br /&gt;    DivEd.setAttribute(&quot;style&quot;,&quot;display:none&quot;);&lt;br /&gt;    UpdateLink=document.createElement(&quot;a&quot;,&quot;&quot;);&lt;br /&gt;    UpdateLink.setAttribute(&quot;href&quot;,&quot;Javascript&quot;);&lt;br /&gt;    UpdateLink.setAttribute(&quot;onClick&quot;,&quot;return GetDataUpdate(&#39;hdnConId&quot;+i+&quot;&#39;,&#39;text&quot;+i+&quot;&#39;,&#39;divNameRd&quot;+i+&quot;&#39;,&#39;textmail&quot;+i+&quot;&#39;,&#39;divMailRd&quot;+i+&quot;&#39;,&#39;divErr&quot;+i+&quot;&#39;);&quot;);&lt;br /&gt;    UpdateLink.innerHTML=&quot;Update |&quot;;&lt;br /&gt;    DivEd.appendChild(UpdateLink);&lt;br /&gt;    CancelLink=document.createElement(&quot;a&quot;,&quot;&quot;);&lt;br /&gt;    CancelLink.setAttribute(&quot;href&quot;,&quot;Javascript&quot;);&lt;br /&gt;    CancelLink.setAttribute(&quot;onClick&quot;,&lt;br /&gt;          &quot;return GetReadMode(&#39;divEd&quot;+i+&quot;&#39;,&#39;divRd&quot;+i+&quot;&#39;,&#39;divNameEd&quot;+i+&quot;&#39;,&#39;divNameRd&quot;+i+&quot;&#39;,&#39;divMailEd&quot;+i+&quot;&#39;,&#39;divMailRd&quot;+i+&quot;&#39;,&#39;divErr&quot;+i+&quot;&#39;);&quot;);&lt;br /&gt;    CancelLink.innerHTML=&quot;Cancel&quot;;&lt;br /&gt;    DivEd.appendChild(CancelLink);&lt;br /&gt;    Td3.appendChild(DivEd);&lt;br /&gt;    //-------&lt;br /&gt;    Tr.appendChild(Td3);&lt;br /&gt;    Table.appendChild(Tr);&lt;br /&gt;   }&lt;br /&gt;   &lt;br /&gt; return div.appendChild(Table);&lt;br /&gt;}&lt;br /&gt;function CheckName(Name)&lt;br /&gt;{&lt;br /&gt; alert(Name);&lt;br /&gt; return false;&lt;br /&gt;}&lt;br /&gt;function GetEditMode(divEdit,divRead,divNameEd,divNameRd,divMailEd,divMailRd,Trow)&lt;br /&gt;{&lt;br /&gt; document.getElementById(&#39;EditedRowNo&#39;).value=divEdit.split(&#39;divEd&#39;)[1];&lt;br /&gt; var i;&lt;br /&gt; i=0;&lt;br /&gt; for(i=0;i&lt;trow;i++) for=&quot;&quot; whick=&quot;&quot; edited=&quot;&quot; then=&quot;&quot; all=&quot;&quot; other=&quot;&quot; row=&quot;&quot; going=&quot;&quot; in=&quot;&quot; read=&quot;&quot; mode=&quot;&quot; dived=&quot;&quot; divrd=&quot;&quot; divnameed=&quot;&quot; divnamerd=&quot;&quot; divmailed=&quot;&quot; divmailrd=&quot;&quot; display=&quot;none&quot; contactid=&quot;document.getElementById(ConId).value;&quot; currnentpg=&quot;document.getElementById(&#39;hdnCurrPg&#39;).value;&quot; innerhtml=&quot;&quot; textid=&quot;divErr.split(&#39;divErr&#39;)[1];&quot; text=&quot;&quot; else=&quot;&quot; if=&quot;&quot; try=&quot;&quot; var=&quot;&quot; params=&quot;ContactId=&quot; oldname=&quot;document.getElementById(OldName).innerHTML;&quot; newname=&quot;document.getElementById(NewName).value;&quot; oldemail=&quot;document.getElementById(OldEmail).innerHTML;&quot; newemail=&quot;document.getElementById(NewEmail).value;&quot; compid=&quot;document.getElementById(&#39;CompList&#39;).value;&quot; deptid=&quot;document.getElementById(&#39;DeptList&#39;).value;&quot; empid=&quot;document.getElementById(&#39;EmpList&#39;).value;&quot; offset=&quot;document.getElementById(&#39;hdnoffset&#39;).value;&quot; get=&quot;&quot; xml=&quot;&quot; onreadystatechange=&quot;EmpDtlRequestStateChange;&quot; catch=&quot;&quot; can=&quot;&quot; t=&quot;&quot; connect=&quot;&quot; to=&quot;&quot; n=&quot;&quot; hdncurrpg=&quot;&quot; hdnoffset=&quot;&quot; value=&quot;divNameRd.innerHTML;&quot; return=&quot;&quot; function=&quot;&quot; currpg=&quot;document.getElementById(&#39;hdnCurrPg&#39;).value;&quot; totalrow=&quot;document.getElementById(&#39;hdnTotalRow&#39;).value;&quot; totalpage=&quot;document.getElementById(&#39;hdnTotalPage&#39;).value;&quot; pagesize=&quot;+PageSize+&quot;&gt;1))&lt;br /&gt; {&lt;br /&gt; document.getElementById(&#39;hdnCurrPg&#39;).value=parseInt(currPg)-1;&lt;br /&gt; document.getElementById(&#39;hdnoffset&#39;).value=parseInt(document.getElementById(&#39;hdnoffset&#39;).value)-parseInt(PageSize);&lt;br /&gt; GetEmpDetail();&lt;br /&gt; }&lt;br /&gt; return false;&lt;br /&gt;}&lt;br /&gt;function DropChange()&lt;br /&gt;{&lt;br /&gt; document.getElementById(&#39;hdnCurrPg&#39;).value=1;&lt;br /&gt; document.getElementById(&#39;hdnoffset&#39;).value=0;&lt;br /&gt; document.getElementById(&#39;hdnTotalRow&#39;).value=&#39;&#39;;&lt;br /&gt; document.getElementById(&#39;hdnTotalPage&#39;).value=&#39;&#39;;&lt;br /&gt; GetEmpDetail();&lt;br /&gt;}&lt;br /&gt;&lt;/trow;i++)&gt;&lt;/enamedtlarray.length;&gt;&lt;/evaluearray.length;&gt;&lt;/dvaluearray.length;&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhavaldchauhan.blogspot.com/feeds/5571302512034945753/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5272785075638971360/5571302512034945753?isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/5571302512034945753'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/5571302512034945753'/><link rel='alternate' type='text/html' href='http://dhavaldchauhan.blogspot.com/2008/08/javascript-for-work-with-ajax.html' title='Javascript for Work WIth Ajax'/><author><name>Dhaval Chauhan</name><uri>http://www.blogger.com/profile/09825343181598773305</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIy30CFXmSnfDgARcOeX5neh8pDl4zf1mlZBUFsolr8Ikyws1Xlvf-1n8mJAZIX8AngQE5IWG91OV1xc9mjvL-VXEhV6TuBleFg-w8UoRCihX8OOD_6q58jTPiCdSr/s220/MyPhoto.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5272785075638971360.post-5323081124151334855</id><published>2008-05-29T15:57:00.000+05:30</published><updated>2008-05-29T16:23:30.750+05:30</updated><title type='text'>Gridview-  Pagging</title><content type='html'>--------------Step-1----------&lt;br /&gt;Add Folowing code in .aspx page in asp:gridview paging templete&lt;br /&gt;------------------------------&lt;br /&gt;&lt;PagerTemplate&gt;&lt;br /&gt;                                             &lt;br /&gt;                                                        &lt;asp:LinkButton CssClass=&quot;HeaderLink&quot; CausesValidation=&quot;false&quot; ID=&quot;lbPrevious&quot; runat=&quot;server&quot;&lt;br /&gt;                                                            EnableViewState=&quot;false&quot; Text=&quot;Previous&quot; CommandName=&quot;page&quot; CommandArgument=&quot;prev&quot;&gt;&lt;br /&gt;                                                        &lt;/asp:LinkButton&gt;&lt;br /&gt;                                                        &amp;nbsp;|&amp;nbsp;&lt;br /&gt;                                                        &lt;asp:LinkButton CssClass=&quot;HeaderLink&quot; CausesValidation=&quot;false&quot; ID=&quot;lbNext&quot; runat=&quot;server&quot;&lt;br /&gt;                                                            EnableViewState=&quot;false&quot; Text=&quot;Next&quot; CommandName=&quot;page&quot; CommandArgument=&quot;next&quot;&gt;&lt;br /&gt;                                                        &lt;/asp:LinkButton&gt;&lt;br /&gt;                                                            &amp;nbsp;&amp;nbsp; &lt;i&gt;&lt;br /&gt;                                                        &lt;asp:Label CssClass=&quot;Data&quot; EnableViewState=&quot;false&quot; ID=&quot;lblPosition&quot; runat=&quot;server&quot;&lt;br /&gt;                                                        Text=&#39; SSLib.GetPosition(gvOrderList)&#39;&gt;&lt;/asp:Label&gt;&lt;br /&gt;                                                        &lt;/i&gt;&lt;br /&gt;                                             &lt;br /&gt;                                            &lt;/PagerTemplate&gt;&lt;br /&gt;-----------------------------------------------&lt;br /&gt;---------------------step-2-------------------&lt;br /&gt;in back-side-aspx.vb page add following&lt;br /&gt;----------------------------------------------&lt;br /&gt;    Protected Sub Page_PreRenderComplete(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRenderComplete&lt;br /&gt;        Dim Paging As New GridViewPaging&lt;br /&gt;        Paging.GridViewPaging(gvClientList)&lt;br /&gt;    End Sub&lt;br /&gt;-------------------------------------------------&lt;br /&gt;---------------------step-3------------------&lt;br /&gt;-------------------------------------------&lt;br /&gt;add following 2-class in project------------&lt;br /&gt;-------------------------------------------&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Class1=&lt;/span&gt;&lt;br /&gt;-------&lt;br /&gt;Public Class GridViewPaging&lt;br /&gt;    Function GridViewPaging(ByVal GridViewId As GridView) As Boolean&lt;br /&gt;        Dim pagetoprow As GridViewRow = GridViewId.TopPagerRow&lt;br /&gt;        Dim pagerbotomrow As GridViewRow = GridViewId.BottomPagerRow&lt;br /&gt;        If Not (IsNothing(pagerbotomrow)) Then&lt;br /&gt;            If (GridViewId.PageIndex) = 0 Then&lt;br /&gt;                CType(GridViewId.BottomPagerRow.FindControl(&quot;lbPrevious&quot;), LinkButton).Enabled = False&lt;br /&gt;                CType(GridViewId.BottomPagerRow.FindControl(&quot;lbPrevious&quot;), LinkButton).CssClass = &quot;DisableLink&quot;&lt;br /&gt;            End If&lt;br /&gt;            If (GridViewId.PageIndex + 1) = GridViewId.PageCount Then&lt;br /&gt;                CType(GridViewId.BottomPagerRow.FindControl(&quot;lbNext&quot;), LinkButton).Enabled = False&lt;br /&gt;                CType(GridViewId.BottomPagerRow.FindControl(&quot;lbNext&quot;), LinkButton).CssClass = &quot;DisableLink&quot;&lt;br /&gt;            End If&lt;br /&gt;        End If&lt;br /&gt;        If Not (IsNothing(pagetoprow)) Then&lt;br /&gt;            If (GridViewId.PageIndex) = 0 Then&lt;br /&gt;                CType(GridViewId.TopPagerRow.FindControl(&quot;lbPrevious&quot;), LinkButton).Enabled = False&lt;br /&gt;                CType(GridViewId.TopPagerRow.FindControl(&quot;lbPrevious&quot;), LinkButton).CssClass = &quot;DisableLink&quot;&lt;br /&gt;            End If&lt;br /&gt;            If (GridViewId.PageIndex + 1) = GridViewId.PageCount Then&lt;br /&gt;                CType(GridViewId.TopPagerRow.FindControl(&quot;lbNext&quot;), LinkButton).Enabled = False&lt;br /&gt;                CType(GridViewId.TopPagerRow.FindControl(&quot;lbNext&quot;), LinkButton).CssClass = &quot;DisableLink&quot;&lt;br /&gt;            End If&lt;br /&gt;        End If&lt;br /&gt;    End Function&lt;br /&gt;---------------------------------------&lt;br /&gt;------class2-----------&lt;br /&gt;--------------------------------------&lt;br /&gt;Public Shared Function GetPosition(ByVal gv As GridView) As String&lt;br /&gt;        Return &quot;( &quot; &amp; (gv.PageIndex + 1).ToString &amp; &quot; of &quot; &amp; gv.PageCount &amp; &quot; )&quot;&lt;br /&gt;    End Function&lt;br /&gt;&lt;br /&gt;    Public Shared Function GetPosition(ByVal fv As FormView) As String&lt;br /&gt;        Return &quot;( &quot; &amp; (fv.PageIndex + 1).ToString &amp; &quot; of &quot; &amp; fv.PageCount &amp; &quot; )&quot;&lt;br /&gt;    End Function&lt;br /&gt;&lt;br /&gt;    Public Shared Function GetPageIndex(ByVal idx As Integer) As Integer&lt;br /&gt;        Return idx + (CInt(HttpContext.Current.Request(&quot;Pg&quot;)) * 12)&lt;br /&gt;    End Function</content><link rel='replies' type='application/atom+xml' href='http://dhavaldchauhan.blogspot.com/feeds/5323081124151334855/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5272785075638971360/5323081124151334855?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/5323081124151334855'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/5323081124151334855'/><link rel='alternate' type='text/html' href='http://dhavaldchauhan.blogspot.com/2008/05/gridview-pagging.html' title='Gridview-  Pagging'/><author><name>Dhaval Chauhan</name><uri>http://www.blogger.com/profile/09825343181598773305</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIy30CFXmSnfDgARcOeX5neh8pDl4zf1mlZBUFsolr8Ikyws1Xlvf-1n8mJAZIX8AngQE5IWG91OV1xc9mjvL-VXEhV6TuBleFg-w8UoRCihX8OOD_6q58jTPiCdSr/s220/MyPhoto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5272785075638971360.post-274168162972602842</id><published>2008-05-29T14:17:00.000+05:30</published><updated>2008-05-29T14:18:45.634+05:30</updated><title type='text'>Javascript-Auto call  function</title><content type='html'>onLoad=window.setTimeout(&quot;StartText(25)&quot;,100);&lt;br /&gt;var y&lt;br /&gt;var timerID = 0;&lt;br /&gt;function StartText(x)&lt;br /&gt;{&lt;br /&gt;    document.getElementById (&#39;AdOrCon&#39;).style .fontSize =x+&quot;px&quot;;&lt;br /&gt;    if (x==40)&lt;br /&gt;    {y=1;}&lt;br /&gt;    else{&lt;br /&gt;    y=x+1;}&lt;br /&gt;    clearTimeout(timerID);&lt;br /&gt;    timerID=0;&lt;br /&gt;    timerID=setTimeout(&quot;StartText(y)&quot;,100);&lt;br /&gt;}&lt;br /&gt;function showTab(x)&lt;br /&gt;{&lt;br /&gt;    document.getElementById(&#39;Div1&#39;).style.display=&quot;none&quot;;&lt;br /&gt;    document.getElementById(&#39;Div2&#39;).style.display=&quot;none&quot;;&lt;br /&gt;    document.getElementById(&#39;Div3&#39;).style.display=&quot;none&quot;;&lt;br /&gt;    document.getElementById(&#39;Div4&#39;).style.display=&quot;none&quot;;&lt;br /&gt;    document.getElementById(&#39;Div5&#39;).style.display=&quot;none&quot;;&lt;br /&gt;    document.getElementById(&#39;Div&#39;+x).style.display=&quot;&quot;;&lt;br /&gt;    if (x==5)&lt;br /&gt;     { y=1 ;}&lt;br /&gt;    else&lt;br /&gt;     { y=x+1; }&lt;br /&gt;    clearTimeout(timerID);&lt;br /&gt;    timerID=0;&lt;br /&gt;    timerID = setTimeout(&quot;showTab(y)&quot;, 10000);&lt;br /&gt;    &lt;br /&gt;}</content><link rel='replies' type='application/atom+xml' href='http://dhavaldchauhan.blogspot.com/feeds/274168162972602842/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5272785075638971360/274168162972602842?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/274168162972602842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/274168162972602842'/><link rel='alternate' type='text/html' href='http://dhavaldchauhan.blogspot.com/2008/05/javascript-auto-call-function.html' title='Javascript-Auto call  function'/><author><name>Dhaval Chauhan</name><uri>http://www.blogger.com/profile/09825343181598773305</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIy30CFXmSnfDgARcOeX5neh8pDl4zf1mlZBUFsolr8Ikyws1Xlvf-1n8mJAZIX8AngQE5IWG91OV1xc9mjvL-VXEhV6TuBleFg-w8UoRCihX8OOD_6q58jTPiCdSr/s220/MyPhoto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5272785075638971360.post-1039341974363376764</id><published>2008-05-29T11:42:00.000+05:30</published><updated>2008-05-29T11:43:39.991+05:30</updated><title type='text'>Javascript-window open</title><content type='html'>window.open((&#39;ZoomImage.aspx?Categoryid=&#39; + catid + &#39;&amp;pageIndex=&#39; + curpg + &#39;&amp;RowPerPage=100&amp;RowCnt=0&amp;PgCnt=0&amp;PgInfo=0&#39;),&#39;zoomimage&#39;,&#39;status=no,width=550,height=500, resizable= no, scrollbars=Yes, toolbar=no,location=no,menubar=no,left=200,top=20&#39;,&#39;&#39;);</content><link rel='replies' type='application/atom+xml' href='http://dhavaldchauhan.blogspot.com/feeds/1039341974363376764/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5272785075638971360/1039341974363376764?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/1039341974363376764'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/1039341974363376764'/><link rel='alternate' type='text/html' href='http://dhavaldchauhan.blogspot.com/2008/05/javascript-window-open.html' title='Javascript-window open'/><author><name>Dhaval Chauhan</name><uri>http://www.blogger.com/profile/09825343181598773305</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIy30CFXmSnfDgARcOeX5neh8pDl4zf1mlZBUFsolr8Ikyws1Xlvf-1n8mJAZIX8AngQE5IWG91OV1xc9mjvL-VXEhV6TuBleFg-w8UoRCihX8OOD_6q58jTPiCdSr/s220/MyPhoto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5272785075638971360.post-5960336748198083646</id><published>2008-05-21T14:32:00.000+05:30</published><updated>2008-05-21T15:05:06.405+05:30</updated><title type='text'>Shopping Cart With Session</title><content type='html'>Imports System.Data&lt;br /&gt;Partial Class ViewCart&lt;br /&gt;    Inherits System.Web.UI.Page&lt;br /&gt;    Dim objDT As System.Data.DataTable&lt;br /&gt;    Dim objDR As System.Data.DataRow&lt;br /&gt;    Public Total As Decimal&lt;br /&gt;&lt;br /&gt;    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load&lt;br /&gt;        If Not IsPostBack Then&lt;br /&gt;            If Session(&quot;StartCart&quot;) = Nothing Then&lt;br /&gt;                makeCart()&lt;br /&gt;                AddToCart(Nothing, Nothing)&lt;br /&gt;                GetItemTotal()&lt;br /&gt;            Else&lt;br /&gt;                objDT = Session(&quot;Cart&quot;)&lt;br /&gt;                Dim itemCount As String = objDT.Rows.Count&lt;br /&gt;                Dim sessICount() As String = Session.Item(&quot;Product&quot;).Split(&quot;,&quot;)&lt;br /&gt;                If itemCount &lt;&gt; sessICount.Length Then&lt;br /&gt;                    &#39;--------&lt;br /&gt;                    Dim i As Integer = 0&lt;br /&gt;                    For i = (itemCount) To sessICount.Length - 1&lt;br /&gt;                        &#39;Dim Product = a(i)&lt;br /&gt;                        Dim adp_CartPrd As New ViewCartDsTableAdapters.Product_MasterTableAdapter&lt;br /&gt;                        Dim tb_CartPrd As New ViewCartDs.Product_MasterDataTable&lt;br /&gt;                        adp_CartPrd.FillProductByPId(tb_CartPrd, sessICount(i))&lt;br /&gt;                        objDR = objDT.NewRow&lt;br /&gt;                        objDR(&quot;Quantity&quot;) = 1&lt;br /&gt;                        objDR(&quot;Image&quot;) = tb_CartPrd.Rows(0).Item(&quot;ProdImage&quot;)&lt;br /&gt;                        objDR(&quot;Product&quot;) = tb_CartPrd.Rows(0).Item(&quot;ProdName&quot;)&lt;br /&gt;                        objDR(&quot;Cost&quot;) = Decimal.Parse(123.5)&lt;br /&gt;                        objDR(&quot;ProdId&quot;) = tb_CartPrd.Rows(0).Item(&quot;ProdId&quot;)&lt;br /&gt;                        objDT.Rows.Add(objDR)&lt;br /&gt;                        Session(&quot;Cart&quot;) = objDT&lt;br /&gt;                        gvCart.DataSource = objDT&lt;br /&gt;                        gvCart.DataBind()&lt;br /&gt;                        GetItemTotal()&lt;br /&gt;                    Next&lt;br /&gt;                    &#39;---------&lt;br /&gt;                Else&lt;br /&gt;                    gvCart.DataSource = objDT&lt;br /&gt;                    gvCart.DataBind()&lt;br /&gt;                    GetItemTotal()&lt;br /&gt;                End If&lt;br /&gt;                &lt;br /&gt;            End If&lt;br /&gt;        Else&lt;br /&gt;            Dim i As Integer&lt;br /&gt;            i = 0&lt;br /&gt;            makeCart()&lt;br /&gt;            For i = 0 To gvCart.Rows.Count - 1&lt;br /&gt;                Dim sess As String = Session(&quot;Product&quot;)&lt;br /&gt;                Dim a() As String = sess.Split(&quot;,&quot;)&lt;br /&gt;                Dim Product = a(i)&lt;br /&gt;                Dim adp_CartPrd As New ViewCartDsTableAdapters.Product_MasterTableAdapter&lt;br /&gt;                Dim tb_CartPrd As New ViewCartDs.Product_MasterDataTable&lt;br /&gt;                adp_CartPrd.FillProductByPId(tb_CartPrd, a(i))&lt;br /&gt;                objDR = objDT.NewRow&lt;br /&gt;                objDR(&quot;Quantity&quot;) = CType(gvCart.Rows(i).FindControl(&quot;textQuantity&quot;), TextBox).Text&lt;br /&gt;                objDR(&quot;Image&quot;) = tb_CartPrd.Rows(0).Item(&quot;ProdImage&quot;)&lt;br /&gt;                objDR(&quot;Product&quot;) = tb_CartPrd.Rows(0).Item(&quot;ProdName&quot;)&lt;br /&gt;                objDR(&quot;Cost&quot;) = Decimal.Parse(123.5)&lt;br /&gt;                objDR(&quot;ProdId&quot;) = tb_CartPrd.Rows(0).Item(&quot;ProdId&quot;)&lt;br /&gt;                objDT.Rows.Add(objDR)&lt;br /&gt;            Next&lt;br /&gt;            Session(&quot;Cart&quot;) = objDT&lt;br /&gt;            gvCart.DataSource = objDT&lt;br /&gt;            gvCart.DataBind()&lt;br /&gt;            GetItemTotal()&lt;br /&gt;        End If&lt;br /&gt;    End Sub&lt;br /&gt;    Sub AddToCart(ByVal s As Object, ByVal e As EventArgs)&lt;br /&gt;        Dim sess As String = Session(&quot;Product&quot;)&lt;br /&gt;        Dim a() As String = sess.Split(&quot;,&quot;)&lt;br /&gt;        Dim i As Integer&lt;br /&gt;        i = 0&lt;br /&gt;        objDT = Session(&quot;Cart&quot;)&lt;br /&gt;        Session(&quot;StartCart&quot;) = &quot;Start&quot;&lt;br /&gt;        For i = 0 To a.Length - 1&lt;br /&gt;            Dim Product = a(i)&lt;br /&gt;            Dim adp_CartPrd As New ViewCartDsTableAdapters.Product_MasterTableAdapter&lt;br /&gt;            Dim tb_CartPrd As New ViewCartDs.Product_MasterDataTable&lt;br /&gt;            adp_CartPrd.FillProductByPId(tb_CartPrd, a(i))&lt;br /&gt;            objDR = objDT.NewRow&lt;br /&gt;            objDR(&quot;Quantity&quot;) = 1&lt;br /&gt;            objDR(&quot;Image&quot;) = tb_CartPrd.Rows(0).Item(&quot;ProdImage&quot;)&lt;br /&gt;            objDR(&quot;Product&quot;) = tb_CartPrd.Rows(0).Item(&quot;ProdName&quot;)&lt;br /&gt;            objDR(&quot;Cost&quot;) = Decimal.Parse(123.5)&lt;br /&gt;            objDR(&quot;ProdId&quot;) = tb_CartPrd.Rows(0).Item(&quot;ProdId&quot;)&lt;br /&gt;            objDT.Rows.Add(objDR)&lt;br /&gt;            Session(&quot;Cart&quot;) = objDT&lt;br /&gt;            gvCart.DataSource = objDT&lt;br /&gt;            gvCart.DataBind()&lt;br /&gt;        Next&lt;br /&gt;    End Sub&lt;br /&gt;    Function makeCart()&lt;br /&gt;        objDT = New System.Data.DataTable(&quot;Cart&quot;)&lt;br /&gt;        &#39;objDT.Columns.Add(&quot;ID&quot;, GetType(Integer))&lt;br /&gt;        &#39;objDT.Columns(&quot;ID&quot;).AutoIncrement = True&lt;br /&gt;        &#39;objDT.Columns(&quot;ID&quot;).AutoIncrementSeed = 1&lt;br /&gt;        objDT.Columns.Add(&quot;ProdId&quot;, GetType(String))&lt;br /&gt;        objDT.Columns.Add(&quot;Image&quot;, GetType(String))&lt;br /&gt;        objDT.Columns.Add(&quot;Product&quot;, GetType(String))&lt;br /&gt;        objDT.Columns.Add(&quot;Quantity&quot;, GetType(Integer))&lt;br /&gt;        objDT.Columns.Add(&quot;Cost&quot;, GetType(Decimal))&lt;br /&gt;        Session(&quot;Cart&quot;) = objDT&lt;br /&gt;        Return &quot;&quot;&lt;br /&gt;    End Function&lt;br /&gt;    Function GetItemTotal() As Decimal&lt;br /&gt;        Dim intCounter As Integer&lt;br /&gt;        Dim decRunningTotal As Decimal&lt;br /&gt;        For intCounter = 0 To objDT.Rows.Count - 1&lt;br /&gt;            objDR = objDT.Rows(intCounter)&lt;br /&gt;            decRunningTotal += (objDR(&quot;Cost&quot;) * objDR(&quot;Quantity&quot;))&lt;br /&gt;        Next&lt;br /&gt;        Total = decRunningTotal&lt;br /&gt;        Return decRunningTotal&lt;br /&gt;    End Function</content><link rel='replies' type='application/atom+xml' href='http://dhavaldchauhan.blogspot.com/feeds/5960336748198083646/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5272785075638971360/5960336748198083646?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/5960336748198083646'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5272785075638971360/posts/default/5960336748198083646'/><link rel='alternate' type='text/html' href='http://dhavaldchauhan.blogspot.com/2008/05/shopping-cart-with-session.html' title='Shopping Cart With Session'/><author><name>Dhaval Chauhan</name><uri>http://www.blogger.com/profile/09825343181598773305</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIy30CFXmSnfDgARcOeX5neh8pDl4zf1mlZBUFsolr8Ikyws1Xlvf-1n8mJAZIX8AngQE5IWG91OV1xc9mjvL-VXEhV6TuBleFg-w8UoRCihX8OOD_6q58jTPiCdSr/s220/MyPhoto.jpg'/></author><thr:total>0</thr:total></entry></feed>