{"id":1068,"date":"2012-10-11T13:07:49","date_gmt":"2012-10-11T04:07:49","guid":{"rendered":"http:\/\/auctionpro.co.kr\/?p=1068"},"modified":"2012-10-11T13:07:49","modified_gmt":"2012-10-11T04:07:49","slug":"sqldatareader-%ed%81%b4%eb%9e%98%ec%8a%a4","status":"publish","type":"post","link":"https:\/\/www.auctionpro.co.kr\/?p=1068","title":{"rendered":"SqlDataReader \ud074\ub798\uc2a4"},"content":{"rendered":"<p><strong>SqlDataReader<\/strong>\ub97c \ub9cc\ub4e4\ub824\uba74, \uc0dd\uc131\uc790\ub97c \uc9c1\uc811 \uc0ac\uc6a9\ud558\uc9c0 \uc54a\uace0\u00a0<a href=\"http:\/\/msdn.microsoft.com\/ko-kr\/library\/system.data.sqlclient.sqlcommand(v=vs.80).aspx\">SqlCommand<\/a>\u00a0\uac1c\uccb4\uc758\u00a0<a href=\"http:\/\/msdn.microsoft.com\/ko-kr\/library\/system.data.sqlclient.sqlcommand.executereader(v=vs.80).aspx\">ExecuteReader<\/a>\u00a0\uba54\uc11c\ub4dc\ub97c \ud638\ucd9c\ud574\uc57c \ud569\ub2c8\ub2e4.<\/p>\n<p><span style=\"color: #008000;\"><strong>SqlDataReader<\/strong>\uac00 \uc0ac\uc6a9 \uc911\uc774\uba74, \uad00\ub828\u00a0<a href=\"http:\/\/msdn.microsoft.com\/ko-kr\/library\/system.data.sqlclient.sqlconnection(v=vs.80).aspx\"><span style=\"color: #008000;\">SqlConnection<\/span><\/a>\uc774\u00a0<strong>SqlDataReader<\/strong>\ub97c \uc0ac\uc6a9\ud558\uace0 \uc788\uc73c\uba70, \uc774\ub97c \ub2eb\uc9c0 \uc54a\uc73c\uba74\u00a0<strong>SqlConnection<\/strong>\uc5d0\uc11c \ub2e4\ub978 \uc791\uc5c5\uc744 \uc218\ud589\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. \uc774\ub7f0 \uc0c1\ud0dc\ub294\u00a0<strong>SqlDataReader<\/strong>\uc758\u00a0<a href=\"http:\/\/msdn.microsoft.com\/ko-kr\/library\/system.data.sqlclient.sqldatareader.close(v=vs.80).aspx\"><span style=\"color: #008000;\">Close<\/span><\/a>\u00a0\uba54\uc11c\ub4dc\uac00 \ud638\ucd9c\ub420 \ub54c\uae4c\uc9c0 \uc801\uc6a9\ub429\ub2c8\ub2e4. \uc608\ub97c \ub4e4\uc5b4,<\/span><span style=\"color: #ff0000;\">\u00a0<strong>Close<\/strong><\/span><span style=\"color: #008000;\">\ub97c \ud638\ucd9c\ud560 \ub54c\uae4c\uc9c0 \ucd9c\ub825 \ub9e4\uac1c \ubcc0\uc218\ub97c \uac80\uc0c9\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p>\ub370\uc774\ud130\ub97c \uc77d\ub294 \ub3d9\uc548 \ub2e4\ub978 \ud504\ub85c\uc138\uc2a4\ub098 \uc2a4\ub808\ub4dc\uc5d0 \uc758\ud574 \uacb0\uacfc \uc9d1\ud569\uc774 \ubcc0\uacbd\ub418\uba74\u00a0<strong>SqlDataReader<\/strong>\uc758 \uc0ac\uc6a9\uc790\uac00 \uc774\ub97c \ubcfc \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uadf8\ub7ec\ub098 \uc138\ubd80\uc801\uc778 \ub3d9\uc791\uc740 \ud0c0\uc774\ubc0d\uc5d0 \ub530\ub77c \ub2ec\ub77c\uc9d1\ub2c8\ub2e4.<\/p>\n<p><a href=\"http:\/\/msdn.microsoft.com\/ko-kr\/library\/system.data.sqlclient.sqldatareader.isclosed(v=vs.80).aspx\">IsClosed<\/a>\uc640\u00a0<a href=\"http:\/\/msdn.microsoft.com\/ko-kr\/library\/system.data.sqlclient.sqldatareader.recordsaffected(v=vs.80).aspx\">RecordsAffected<\/a>\ub294\u00a0<strong>SqlDataReader<\/strong>\ub97c \ub2eb\uc740 \ud6c4\uc5d0 \ud638\ucd9c\ud560 \uc218 \uc788\ub294 \uc720\uc77c\ud55c \uc18d\uc131\uc785\ub2c8\ub2e4.\u00a0<strong>SqlDataReader<\/strong>\uac00 \uc874\uc7ac\ud558\ub294 \ub3d9\uc548\u00a0<strong>RecordsAffected<\/strong>\u00a0\uc18d\uc131\uc5d0 \uc561\uc138\uc2a4\ud560 \uc218 \uc788\uc9c0\ub9cc,\u00a0<strong>RecordsAffected<\/strong>\uc758 \uac12\uc744 \ubc18\ud658\ud558\uae30 \uc804\uc5d0 \ud56d\uc0c1\u00a0<strong>Close<\/strong>\ub97c \ud638\ucd9c\ud558\uc5ec \ubc18\ud658 \uac12\uc774 \uc815\ud655\ud558\ub3c4\ub85d \ud569\ub2c8\ub2e4.<\/p>\n<div>\n<p>\ub2e4\uc74c \uc608\uc81c\uc5d0\uc11c\ub294\u00a0<strong>SqlConnection<\/strong>,\u00a0<strong>SqlCommand<\/strong>,\u00a0<strong>SqlDataReader<\/strong>\u00a0\ub4f1\uc744 \ub9cc\ub4ed\ub2c8\ub2e4. \uc774 \uc608\uc81c\uc5d0\uc11c\ub294 \ub370\uc774\ud130\ub97c \uc77d\uace0 \ud574\ub2f9 \ub370\uc774\ud130\ub97c \ucf58\uc194 \ucc3d\uc5d0 \uc501\ub2c8\ub2e4. \uadf8\ub7f0 \ub2e4\uc74c<strong>SqlDataReader<\/strong>\ub97c \ub2eb\uc2b5\ub2c8\ub2e4.\u00a0<strong>SqlConnection<\/strong>\uc740\u00a0<strong>using<\/strong>\u00a0\ucf54\ub4dc \ube14\ub85d\uc758 \ub05d\uc5d0\uc11c \uc790\ub3d9\uc73c\ub85c \ub2eb\ud799\ub2c8\ub2e4.<\/p>\n<div>\n<div>\n<div id=\"CodeSnippetContainerCode_5a43639d-a457-48f9-94f4-7bd4383482c8\" dir=\"ltr\">\n<div>\n<pre>private static void ReadOrderData(string connectionString)\r\n{\r\n    string queryString =\r\n        \"SELECT OrderID, CustomerID FROM dbo.Orders;\";\r\n\r\n    using (SqlConnection connection =\r\n               new SqlConnection(connectionString))\r\n    {\r\n        SqlCommand command =\r\n            new SqlCommand(queryString, connection);\r\n        connection.Open();\r\n\r\n        SqlDataReader reader = command.ExecuteReader();\r\n\r\n        \/\/ Call Read before accessing data.\r\n        while (reader.Read())\r\n        {\r\n            Console.WriteLine(String.Format(\"{0}, {1}\",\r\n                reader[0], reader[1]));\r\n        }\r\n\r\n        \/\/ Call Close when done reading.\r\n        reader.Close();\r\n    }\r\n}<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>SqlDataReader\ub97c \ub9cc\ub4e4\ub824\uba74, \uc0dd\uc131\uc790\ub97c \uc9c1\uc811 \uc0ac\uc6a9\ud558\uc9c0 \uc54a\uace0\u00a0SqlCommand\u00a0\uac1c\uccb4\uc758\u00a0ExecuteReader\u00a0\uba54\uc11c\ub4dc\ub97c \ud638\ucd9c\ud574\uc57c \ud569\ub2c8\ub2e4. SqlDataReader\uac00 \uc0ac\uc6a9 \uc911\uc774\uba74, \uad00\ub828\u00a0SqlConnection\uc774\u00a0SqlDataReader\ub97c \uc0ac\uc6a9\ud558\uace0 \uc788\uc73c\uba70, \uc774\ub97c \ub2eb\uc9c0 \uc54a\uc73c\uba74\u00a0SqlConnection\uc5d0\uc11c \ub2e4\ub978 \uc791\uc5c5\uc744 \uc218\ud589\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. \uc774\ub7f0 \uc0c1\ud0dc\ub294\u00a0SqlDataReader\uc758\u00a0Close\u00a0\uba54\uc11c\ub4dc\uac00 \ud638\ucd9c\ub420 <a class=\"mh-excerpt-more\" href=\"https:\/\/www.auctionpro.co.kr\/?p=1068\" title=\"SqlDataReader \ud074\ub798\uc2a4\">[&#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,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[10],"tags":[],"class_list":["post-1068","post","type-post","status-publish","format-standard","hentry","category-devc"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>SqlDataReader \ud074\ub798\uc2a4 - AuctionPro<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.auctionpro.co.kr\/?p=1068\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SqlDataReader \ud074\ub798\uc2a4 - AuctionPro\" \/>\n<meta property=\"og:description\" content=\"SqlDataReader\ub97c \ub9cc\ub4e4\ub824\uba74, \uc0dd\uc131\uc790\ub97c \uc9c1\uc811 \uc0ac\uc6a9\ud558\uc9c0 \uc54a\uace0\u00a0SqlCommand\u00a0\uac1c\uccb4\uc758\u00a0ExecuteReader\u00a0\uba54\uc11c\ub4dc\ub97c \ud638\ucd9c\ud574\uc57c \ud569\ub2c8\ub2e4. SqlDataReader\uac00 \uc0ac\uc6a9 \uc911\uc774\uba74, \uad00\ub828\u00a0SqlConnection\uc774\u00a0SqlDataReader\ub97c \uc0ac\uc6a9\ud558\uace0 \uc788\uc73c\uba70, \uc774\ub97c \ub2eb\uc9c0 \uc54a\uc73c\uba74\u00a0SqlConnection\uc5d0\uc11c \ub2e4\ub978 \uc791\uc5c5\uc744 \uc218\ud589\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. \uc774\ub7f0 \uc0c1\ud0dc\ub294\u00a0SqlDataReader\uc758\u00a0Close\u00a0\uba54\uc11c\ub4dc\uac00 \ud638\ucd9c\ub420 [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.auctionpro.co.kr\/?p=1068\" \/>\n<meta property=\"og:site_name\" content=\"AuctionPro\" \/>\n<meta property=\"article:published_time\" content=\"2012-10-11T04:07:49+00:00\" \/>\n<meta name=\"author\" content=\"golgol\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\uae00\uc4f4\uc774\" \/>\n\t<meta name=\"twitter:data1\" content=\"golgol\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=1068#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=1068\"},\"author\":{\"name\":\"golgol\",\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/#\\\/schema\\\/person\\\/d3dbae599b06cd55f5b14a3e2116f7a2\"},\"headline\":\"SqlDataReader \ud074\ub798\uc2a4\",\"datePublished\":\"2012-10-11T04:07:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=1068\"},\"wordCount\":26,\"commentCount\":0,\"articleSection\":[\"[Dev]C#\"],\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=1068#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=1068\",\"url\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=1068\",\"name\":\"SqlDataReader \ud074\ub798\uc2a4 - AuctionPro\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/#website\"},\"datePublished\":\"2012-10-11T04:07:49+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/#\\\/schema\\\/person\\\/d3dbae599b06cd55f5b14a3e2116f7a2\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=1068#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=1068\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=1068#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SqlDataReader \ud074\ub798\uc2a4\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/#website\",\"url\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/\",\"name\":\"AuctionPro\",\"description\":\"\uc625\uc158\ud504\ub85c\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/#\\\/schema\\\/person\\\/d3dbae599b06cd55f5b14a3e2116f7a2\",\"name\":\"golgol\",\"url\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?author=6\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SqlDataReader \ud074\ub798\uc2a4 - AuctionPro","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.auctionpro.co.kr\/?p=1068","og_locale":"ko_KR","og_type":"article","og_title":"SqlDataReader \ud074\ub798\uc2a4 - AuctionPro","og_description":"SqlDataReader\ub97c \ub9cc\ub4e4\ub824\uba74, \uc0dd\uc131\uc790\ub97c \uc9c1\uc811 \uc0ac\uc6a9\ud558\uc9c0 \uc54a\uace0\u00a0SqlCommand\u00a0\uac1c\uccb4\uc758\u00a0ExecuteReader\u00a0\uba54\uc11c\ub4dc\ub97c \ud638\ucd9c\ud574\uc57c \ud569\ub2c8\ub2e4. SqlDataReader\uac00 \uc0ac\uc6a9 \uc911\uc774\uba74, \uad00\ub828\u00a0SqlConnection\uc774\u00a0SqlDataReader\ub97c \uc0ac\uc6a9\ud558\uace0 \uc788\uc73c\uba70, \uc774\ub97c \ub2eb\uc9c0 \uc54a\uc73c\uba74\u00a0SqlConnection\uc5d0\uc11c \ub2e4\ub978 \uc791\uc5c5\uc744 \uc218\ud589\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. \uc774\ub7f0 \uc0c1\ud0dc\ub294\u00a0SqlDataReader\uc758\u00a0Close\u00a0\uba54\uc11c\ub4dc\uac00 \ud638\ucd9c\ub420 [...]","og_url":"https:\/\/www.auctionpro.co.kr\/?p=1068","og_site_name":"AuctionPro","article_published_time":"2012-10-11T04:07:49+00:00","author":"golgol","twitter_card":"summary_large_image","twitter_misc":{"\uae00\uc4f4\uc774":"golgol"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.auctionpro.co.kr\/?p=1068#article","isPartOf":{"@id":"https:\/\/www.auctionpro.co.kr\/?p=1068"},"author":{"name":"golgol","@id":"https:\/\/www.auctionpro.co.kr\/#\/schema\/person\/d3dbae599b06cd55f5b14a3e2116f7a2"},"headline":"SqlDataReader \ud074\ub798\uc2a4","datePublished":"2012-10-11T04:07:49+00:00","mainEntityOfPage":{"@id":"https:\/\/www.auctionpro.co.kr\/?p=1068"},"wordCount":26,"commentCount":0,"articleSection":["[Dev]C#"],"inLanguage":"ko-KR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.auctionpro.co.kr\/?p=1068#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.auctionpro.co.kr\/?p=1068","url":"https:\/\/www.auctionpro.co.kr\/?p=1068","name":"SqlDataReader \ud074\ub798\uc2a4 - AuctionPro","isPartOf":{"@id":"https:\/\/www.auctionpro.co.kr\/#website"},"datePublished":"2012-10-11T04:07:49+00:00","author":{"@id":"https:\/\/www.auctionpro.co.kr\/#\/schema\/person\/d3dbae599b06cd55f5b14a3e2116f7a2"},"breadcrumb":{"@id":"https:\/\/www.auctionpro.co.kr\/?p=1068#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.auctionpro.co.kr\/?p=1068"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.auctionpro.co.kr\/?p=1068#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/www.auctionpro.co.kr\/"},{"@type":"ListItem","position":2,"name":"SqlDataReader \ud074\ub798\uc2a4"}]},{"@type":"WebSite","@id":"https:\/\/www.auctionpro.co.kr\/#website","url":"https:\/\/www.auctionpro.co.kr\/","name":"AuctionPro","description":"\uc625\uc158\ud504\ub85c","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.auctionpro.co.kr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Person","@id":"https:\/\/www.auctionpro.co.kr\/#\/schema\/person\/d3dbae599b06cd55f5b14a3e2116f7a2","name":"golgol","url":"https:\/\/www.auctionpro.co.kr\/?author=6"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/1068","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=1068"}],"version-history":[{"count":0,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/1068\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1068"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1068"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1068"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}