{"id":51,"date":"2012-08-06T11:58:04","date_gmt":"2012-08-06T02:58:04","guid":{"rendered":"http:\/\/auctionpro.co.kr\/WPress\/?p=51"},"modified":"2019-08-12T10:11:15","modified_gmt":"2019-08-12T01:11:15","slug":"db-connect","status":"publish","type":"post","link":"https:\/\/www.auctionpro.co.kr\/?p=51","title":{"rendered":"DB connect"},"content":{"rendered":"\n<pre class=\"lang:tsql decode:true \" >class DBData\r\n{\r\nstatic string connectionString = \"server= localhost;uid=user;pwd=pass;database=SSC\";\r\n\r\npublic static string Select(int Sending_SSC)\r\n{\r\nstring ADW = null;\r\n\r\n\/\/SQL \uc5f0\uacb0\uc124\uc815\r\n\/\/Call stored procedure with parameter and return value\r\nSqlConnection conn = new SqlConnection(connectionString);\r\n\r\ntry\r\n{\r\nconn.Open();\r\n\r\nSqlCommand cmd = conn.CreateCommand();\r\n\r\ncmd.CommandType = CommandType.StoredProcedure;\r\ncmd.CommandText = \"GetCachingADW\";\r\n\r\nSqlParameter paramSending_SSC = cmd.Parameters.Add(\"@Sending_SSC\",SqlDbType.SmallInt);\r\nparamSending_SSC.Direction = ParameterDirection.Input;\r\nparamSending_SSC.Value = Sending_SSC;\r\n\r\nSqlDataReader reader = cmd.ExecuteReader();\r\n\r\nif (reader.Read())\r\n{\r\nADW = reader[\"ADW\"].ToString();\r\n}\r\n\r\nreader.Close(); \/\/ &lt;- too easy to forget\r\nreader.Dispose(); \/\/ &lt;- too easy to forget\r\n conn.Close(); \/\/ &lt;- too easy to forget\r\n\r\nreturn ADW;\r\n}\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\n\r\nreturn \"\";\r\n}\r\n\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>class DBData { static string connectionString = &#8220;server= localhost;uid=user;pwd=pass;database=SSC&#8221;; public static string Select(int Sending_SSC) { string ADW = null; \/\/SQL \uc5f0\uacb0\uc124\uc815 \/\/Call stored procedure with <a class=\"mh-excerpt-more\" href=\"https:\/\/www.auctionpro.co.kr\/?p=51\" title=\"DB connect\">[&#8230;]<\/a><\/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-51","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\/51","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=51"}],"version-history":[{"count":0,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/51\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=51"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=51"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=51"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}