{"id":445,"date":"2017-06-05T13:37:06","date_gmt":"2017-06-05T04:37:06","guid":{"rendered":"http:\/\/csharp.ihavenomoney.co.kr\/?p=445"},"modified":"2018-08-17T15:21:59","modified_gmt":"2018-08-17T06:21:59","slug":"sqldataadapter-storedprocedure","status":"publish","type":"post","link":"https:\/\/csharp.ihavenomoney.co.kr\/?p=445","title":{"rendered":"SqlDataAdapter StoredProcedure"},"content":{"rendered":"<p><code><\/p>\n<pre class=\"lang:c# decode:true \" >class DBData\r\n{\r\nstatic string connectionString = \"server= 111.222.333.444;uid=id;pwd=pppp;database=UEUE\";\r\n\r\npublic static string QueueHTML(string SID)\r\n{\r\nSqlConnection conn = new SqlConnection(connectionString);\r\nSqlDataAdapter da = new SqlDataAdapter();\r\nDataSet QUEUE = new DataSet();\r\n\r\ntry {\r\nconn.Open();\r\n\r\nSqlCommand cmd = conn.CreateCommand();\r\ncmd.CommandType = CommandType.StoredProcedure;\r\ncmd.CommandText = \"QueueList\";\r\n\r\nSqlParameter paramSID = cmd.Parameters.Add(\"@SID\", SqlDbType.Char, 3);\r\nparamSID.Direction = ParameterDirection.Input;\r\nparamSID.Value = SID;\r\n\r\nda.SelectCommand = cmd;\r\nda.Fill(QUEUE, \"QUEUE\");\r\n\r\nXslCompiledTransform xslt = new XslCompiledTransform();\r\nStringWriter stringWriter = new StringWriter();\r\n\r\nxslt.Load(\"Queue.xsl\");\r\n\r\nXsltArgumentList args = new XsltArgumentList();\r\n\r\nXmlDocument xml = new XmlDocument();\r\n\r\nstring dbXML = QUEUE.GetXml();\r\nxml.LoadXml(dbXML);\r\n\r\nxslt.Transform(xml, args, stringWriter);\r\n\r\nstring Content = stringWriter.ToString();\r\n\r\nreturn Content;\r\n}\r\ncatch (Exception ex)\r\n{\r\n\/\/\ud074\ub77c\uc774\uc5b8\ud2b8\uc5d0\uac8c \uc608\uc678\ub97c \ub358\uc9c4\ub2e4.\r\n\/\/throw ex;\r\nstring Err = ex.ToString();\r\nreturn \"\";\r\n}\r\n\r\nfinally\r\n{\r\n\r\n}\r\n\r\n}\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>class DBData { static string connectionString = &#8220;server= 111.222.333.444;uid=id;pwd=pppp;database=UEUE&#8221;; public static string QueueHTML(string SID) { SqlConnection conn = new SqlConnection(connectionString); SqlDataAdapter da = new SqlDataAdapter(); DataSet QUEUE = new DataSet(); try { conn.Open(); SqlCommand cmd = conn.CreateCommand(); cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = &#8220;QueueList&#8221;; SqlParameter paramSID = cmd.Parameters.Add(&#8220;@SID&#8221;, SqlDbType.Char, 3); paramSID.Direction = ParameterDirection.Input; paramSID.Value = SID;\u2026 <span class=\"read-more\"><a href=\"https:\/\/csharp.ihavenomoney.co.kr\/?p=445\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[77],"tags":[],"class_list":["post-445","post","type-post","status-publish","format-standard","hentry","category-c-xml"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/csharp.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/445","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/csharp.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/csharp.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/csharp.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/csharp.ihavenomoney.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=445"}],"version-history":[{"count":4,"href":"https:\/\/csharp.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/445\/revisions"}],"predecessor-version":[{"id":457,"href":"https:\/\/csharp.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/445\/revisions\/457"}],"wp:attachment":[{"href":"https:\/\/csharp.ihavenomoney.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=445"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/csharp.ihavenomoney.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=445"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/csharp.ihavenomoney.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=445"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}