﻿
{"id":232,"date":"2012-03-19T21:47:16","date_gmt":"2012-03-19T21:47:16","guid":{"rendered":"http:\/\/www.gencayyildiz.com\/blog\/?p=232"},"modified":"2012-05-28T13:02:23","modified_gmt":"2012-05-28T13:02:23","slug":"cta-using-blogu","status":"publish","type":"post","link":"https:\/\/www.gencayyildiz.com\/blog\/cta-using-blogu\/","title":{"rendered":"C# using Blo\u011fu"},"content":{"rendered":"<div id=\"fb-root\"><\/div>\n<p>Bu yaz\u0131mda C#&#8217;ta using blo\u011fundan bahsedece\u011fim.IDisposable interface inden t\u00fcremi\u015f nesneler using(){} blo\u011fu i\u00e7inde olu\u015fturulursa,using blo\u011fundan \u00e7\u0131k\u0131l\u0131r \u00e7\u0131k\u0131lmaz GC(Garbage Collector)&#8217;ye devredilir ve hemen silinirler(Dispose edilirler).\u00c7\u00fcnk\u00fc IDisposable&#8217;den t\u00fcremi\u015f classlarda %100 Dispose metodu vard\u0131r.using blo\u011fuda asl\u0131nda blok sonunda bu metodu \u00e7al\u0131\u015ft\u0131rmaktad\u0131r.Bu sayede manuel olarak nesneyi Dispose etmemize gerek kalmaz.<br \/>\n<!--more--><\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n using (SqlConnection baglanti = new SqlConnection(&quot;Server=Gencay-Gencay;database=northwind;trusted_connection=true;&quot;))\r\n            {\r\n                using (SqlCommand cmd = new SqlCommand(&quot;Select count(*),Count(PersonelId) from Personeller&quot;, baglanti))\r\n                {\r\n                    baglanti.Open();\r\n                    using (SqlDataReader dr = cmd.ExecuteReader())\r\n                    {\r\n                        dr.Read();\r\n                        MessageBox.Show(dr&#x5B;0] + &quot; &quot; + dr&#x5B;1]);\r\n                    }\r\n                }\r\n                baglanti.Close();\r\n            }\r\n<\/pre>\n<p>Yukar\u0131daki \u00f6rne\u011fi inceleyiniz.<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Bu yaz\u0131mda C#&#8217;ta using blo\u011fundan bahsedece\u011fim.IDisposable interface inden t\u00fcremi\u015f nesneler using(){} blo\u011fu i\u00e7inde olu\u015fturulursa,using blo\u011fundan \u00e7\u0131k\u0131l\u0131r \u00e7\u0131k\u0131lmaz GC(Garbage Collector)&#8217;ye devredilir ve hemen silinirler(Dispose edilirler).\u00c7\u00fcnk\u00fc IDisposable&#8217;den t\u00fcremi\u015f classlarda %100 Dispose metodu vard\u0131r.using blo\u011fuda asl\u0131nda blok&#46;&#46;&#46;<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[151],"class_list":["post-232","post","type-post","status-publish","format-standard","hentry","category-c-sharp-c","tag-using"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/232","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/comments?post=232"}],"version-history":[{"count":0,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/232\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/media?parent=232"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/categories?post=232"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/tags?post=232"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}