{"id":2428,"date":"2013-06-04T11:09:45","date_gmt":"2013-06-04T02:09:45","guid":{"rendered":"http:\/\/auctionpro.co.kr\/?p=2428"},"modified":"2023-11-01T11:18:52","modified_gmt":"2023-11-01T02:18:52","slug":"cdb%ec%97%90%ec%84%9c-xml-%ed%98%95%ec%8b%9d%ec%9c%bc%eb%a1%9c-%ea%b0%80%ec%a0%b8%ec%98%a4%ea%b8%b0","status":"publish","type":"post","link":"https:\/\/www.auctionpro.co.kr\/?p=2428","title":{"rendered":"[C#] DB \uc5d0\uc11c XML \ud615\uc2dd\uc73c\ub85c \uac00\uc838\uc624\uae30"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \" title=\"DB to xml\" >        [WebMethod(Description = \"CountryCodeToXML 2023.11.01\")]\n        public XmlElement CountryCodeToXML()\n        {\n            \/\/SQL \uc5f0\uacb0\uc124\uc815\n            SqlConnection sqlConnection;\n            SqlDataAdapter sqlDataAdapter;\n\n            string connectionString = \"Server=111.111.111.111;User ID=MYID;Password=MYPASSWORD123;Database=MYDBName\";\n\n            sqlConnection = new SqlConnection(connectionString);\n\n            XmlDocument xml = new XmlDocument();\n\n            try\n            {\n                DataSet COUNTRY_CODE;\n\n                \/\/exec COUNTRY_CODE\n                sqlDataAdapter = new SqlDataAdapter(\"COUNTRY_CODE\", sqlConnection);\n                sqlDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;\n\n                \/\/SqlParameter paramAGENT = new SqlParameter(\"@AGENT\", SqlDbType.VarChar, 20);\n                \/\/paramAGENT.Value = AGENT;\n                \/\/sqlDataAdapter.SelectCommand.Parameters.Add(paramAGENT);\n\n                \/\/SqlParameter paramLanguage = new SqlParameter(\"@Language\", SqlDbType.VarChar, 2);\n                \/\/paramLanguage.Value = Language;\n                \/\/sqlDataAdapter.SelectCommand.Parameters.Add(paramLanguage);\n                \/\/\/\/\n\n                COUNTRY_CODE = new DataSet();\n                sqlDataAdapter.Fill(COUNTRY_CODE, \"COUNTRY_CODE\");\n\n                xml.PreserveWhitespace = true;\n                xml.LoadXml(COUNTRY_CODE.GetXml());\n                \n\n            }\n            catch \/\/(Exception ex)\n            {\n                \/\/\ud074\ub77c\uc774\uc5b8\ud2b8\uc5d0\uac8c \uc608\uc678\ub97c \ub358\uc9c4\ub2e4.\n                \/\/throw ex;\n            }\n\n            finally\n            {\n                sqlConnection.Close();\n            }\n\n            return xml.DocumentElement;\n\n        }<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\uacb0\uacfc<\/h2>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"theme:powershell lang:xhtml decode:true \">&lt;NewDataSet&gt;\n&lt;COUNTRY_CODE&gt;\n&lt;CountryCode&gt;AD&lt;\/CountryCode&gt;\n&lt;AreaCode&gt;E1&lt;\/AreaCode&gt;\n&lt;EName&gt;Andorra&lt;\/EName&gt;\n&lt;KName&gt;\uc548\ub3c4\ub77c \uacf5\uad6d&lt;\/KName&gt;\n&lt;OrderNo&gt;0&lt;\/OrderNo&gt;\n&lt;UseFlag&gt;Y&lt;\/UseFlag&gt;\n&lt;StayInd xml:space=\"preserve\"&gt; &lt;\/StayInd&gt;\n&lt;SubAreaCode&gt;E1&lt;\/SubAreaCode&gt;\n&lt;CountryNumber&gt;+376&lt;\/CountryNumber&gt;\n&lt;\/COUNTRY_CODE&gt;\n&lt;COUNTRY_CODE&gt;\n&lt;CountryCode&gt;AE&lt;\/CountryCode&gt;\n&lt;AreaCode&gt;M1&lt;\/AreaCode&gt;\n&lt;EName&gt;United Arab Emirates&lt;\/EName&gt;\n&lt;KName&gt;\uc544\ub78d\uc5d0\ubbf8\ub9ac\ud2b8&lt;\/KName&gt;\n&lt;OrderNo&gt;0&lt;\/OrderNo&gt;\n&lt;UseFlag&gt;Y&lt;\/UseFlag&gt;\n&lt;AreaCodeNew&gt;M1&lt;\/AreaCodeNew&gt;\n&lt;StayInd xml:space=\"preserve\"&gt; &lt;\/StayInd&gt;\n&lt;SubAreaCode&gt;M1&lt;\/SubAreaCode&gt;\n&lt;CountryNumber&gt;+971&lt;\/CountryNumber&gt;\n&lt;\/COUNTRY_CODE&gt;\n&lt;COUNTRY_CODE&gt;\n&lt;CountryCode&gt;AF&lt;\/CountryCode&gt;\n&lt;AreaCode&gt;D1&lt;\/AreaCode&gt;\n&lt;EName&gt;Afghanistan&lt;\/EName&gt;\n&lt;KName&gt;\uc544\ud504\uac00\ub2c8\uc2a4\ud0c4&lt;\/KName&gt;\n&lt;OrderNo&gt;0&lt;\/OrderNo&gt;\n&lt;UseFlag&gt;Y&lt;\/UseFlag&gt;\n&lt;StayInd xml:space=\"preserve\"&gt; &lt;\/StayInd&gt;\n&lt;SubAreaCode&gt;D1&lt;\/SubAreaCode&gt;\n&lt;CountryNumber&gt;+93&lt;\/CountryNumber&gt;\n&lt;\/COUNTRY_CODE&gt;\n:: \uc911\ub7b5 ::<\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>\uacb0\uacfc<\/p>\n<\/div>","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[10],"tags":[],"class_list":["post-2428","post","type-post","status-publish","format-standard","hentry","category-devc"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/2428","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2428"}],"version-history":[{"count":0,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/2428\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2428"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2428"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2428"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}