{"id":151,"date":"2011-01-25T16:02:00","date_gmt":"1970-01-01T00:00:00","guid":{"rendered":"http:\/\/www.yazilimmutfagi.com\/?p=151"},"modified":"2011-01-25T16:02:00","modified_gmt":"1970-01-01T00:00:00","slug":"ado-net-entity-framework-giris","status":"publish","type":"post","link":"https:\/\/www.yazilimmutfagi.com\/index.php\/2011\/01\/25\/ado-net-entity-framework-giris\/","title":{"rendered":"ADO.NET Entity Framework Giris"},"content":{"rendered":"<p>&nbsp;Bu makalemizde Microsoftun ORM ara&ccedil;larindan Entity Framework yapisini kullanarak bir data modeli olusturacagiz ve bu model ile veritabanindan nasil select islemi yapacagimizi &ouml;grenecegiz.<\/p>\n<p class=\"MsoNormal\">Entity Framework hakkinda teorik bilgileri internette bolca bulabilirsiniz bu y&uuml;zden bu konulara deginmeyi d&uuml;s&uuml;nm&uuml;yorum. Ilk olarak visual studio 2008 veya 2010 kullanarak yeni bir websitesi olusturalim. Olusturdugumuz web sitesine asagidaki gibi bir &ldquo;entity framework data model&rdquo; ekleyelim.<\/p>\n<p class=\"MsoNormal\"><span style=\"mso-fareast-language:TR;mso-no-proof:yes\"><!--[if gte vml 1]><v:shapetype\nid=\"_x0000_t75\" coordsize=\"21600,21600\" o:spt=\"75\" o:preferrelative=\"t\"\npath=\"m@4@5l@4@11@9@11@9@5xe\" filled=\"f\" stroked=\"f\">\n<v:stroke joinstyle=\"miter\" \/>\n<v:formulas>\n<v:f eqn=\"if lineDrawn pixelLineWidth 0\" \/>\n<v:f eqn=\"sum @0 1 0\" \/>\n<v:f eqn=\"sum 0 0 @1\" \/>\n<v:f eqn=\"prod @2 1 2\" \/>\n<v:f eqn=\"prod @3 21600 pixelWidth\" \/>\n<v:f eqn=\"prod @3 21600 pixelHeight\" \/>\n<v:f eqn=\"sum @0 0 1\" \/>\n<v:f eqn=\"prod @6 1 2\" \/>\n<v:f eqn=\"prod @7 21600 pixelWidth\" \/>\n<v:f eqn=\"sum @8 21600 0\" \/>\n<v:f eqn=\"prod @7 21600 pixelHeight\" \/>\n<v:f eqn=\"sum @10 21600 0\" \/>\n<\/v:formulas>\n<v:path o:extrusionok=\"f\" gradientshapeok=\"t\" o:connecttype=\"rect\" \/>\n<o:lock v:ext=\"edit\" aspectratio=\"t\" \/>\n<\/v:shapetype><v:shape id=\"Picture_x0020_1\" o:spid=\"_x0000_i1032\" type=\"#_x0000_t75\"\nstyle='width:239.25pt;height:259.5pt;visibility:visible;mso-wrap-style:square'>\n<v:imagedata src=\"file:\/\/\/C:\\Users\\msk\\AppData\\Local\\Temp\\msohtmlclip1\\01\\clip_image001.png\"\no:title=\"entityframework_resim1\" \/>\n<\/v:shape><![endif]--><!--[if !vml]--><img decoding=\"async\" loading=\"lazy\" width=\"319\" height=\"346\" v:shapes=\"Picture_x0020_1\" alt=\"\" src=\"\/yuklenendosyalar\/image\/sabri\/entity1\/entityframework_resim1.jpg\" \/><!--[endif]--><\/span><\/p>\n<p class=\"MsoNormal\"><o:p>&nbsp;<\/o:p><\/p>\n<p class=\"MsoNormal\"><span style=\"mso-fareast-language:TR;mso-no-proof:yes\"><!--[if gte vml 1]><v:shape\nid=\"Picture_x0020_2\" o:spid=\"_x0000_i1031\" type=\"#_x0000_t75\" style='width:453.75pt;\nheight:298.5pt;visibility:visible;mso-wrap-style:square'>\n<v:imagedata src=\"file:\/\/\/C:\\Users\\msk\\AppData\\Local\\Temp\\msohtmlclip1\\01\\clip_image003.png\"\no:title=\"entityframework_resim2\" \/>\n<\/v:shape><![endif]--><!--[if !vml]--><img decoding=\"async\" loading=\"lazy\" width=\"605\" height=\"398\" v:shapes=\"Picture_x0020_2\" alt=\"\" src=\"\/yuklenendosyalar\/image\/sabri\/entity1\/entityframework_resim2.jpg\" \/><!--[endif]--><\/span><\/p>\n<p class=\"MsoNormal\">Yukarida g&ouml;rd&uuml;g&uuml;n&uuml;z gibi ADO.NET Entity Data Model&rsquo;i seyiyoruz ve bir isim veriyoruz. Daha sonra add deyip diger adima ge&ccedil;iyoruz.<br \/>\n<a href='www.yazilimmutfagi.com'>.<\/a><\/p>\n<p class=\"MsoNormal\"><span style=\"mso-fareast-language:TR;mso-no-proof:yes\"><!--[if gte vml 1]><v:shape\nid=\"Picture_x0020_3\" o:spid=\"_x0000_i1030\" type=\"#_x0000_t75\" style='width:453.75pt;\nheight:403.5pt;visibility:visible;mso-wrap-style:square'>\n<v:imagedata src=\"file:\/\/\/C:\\Users\\msk\\AppData\\Local\\Temp\\msohtmlclip1\\01\\clip_image005.png\"\no:title=\"entityframework_resim3\" \/>\n<\/v:shape><![endif]--><!--[if !vml]--><img decoding=\"async\" loading=\"lazy\" width=\"605\" height=\"538\" v:shapes=\"Picture_x0020_3\" alt=\"\" src=\"\/yuklenendosyalar\/image\/sabri\/entity1\/entityframework_resim3.jpg\" \/><!--[endif]--><\/span><\/p>\n<p class=\"MsoNormal\">Biz bu &ouml;rnegimizde modelimizi var olan bir veritabani &uuml;zerinden olusturacagiz. Tam aksine &ouml;nce modeli olusturup EntityFramework&rsquo;&uuml;n veritabanini kendisinin olusturmasini saglayabiliriz. Next dedikten sonra gelen ekranda &ldquo;new connection&rdquo; deyip asagidaki ekranda g&ouml;rd&uuml;g&uuml;m&uuml;z gibi var olan bir veritabani i&ccedil;in connection olusturuyoruz.<\/p>\n<p class=\"MsoNormal\"><o:p>&nbsp;<\/o:p><\/p>\n<p class=\"MsoNormal\"><span style=\"mso-fareast-language:TR;mso-no-proof:yes\"><!--[if gte vml 1]><v:shape\nid=\"Picture_x0020_5\" o:spid=\"_x0000_i1029\" type=\"#_x0000_t75\" style='width:338.25pt;\nheight:494.25pt;visibility:visible;mso-wrap-style:square'>\n<v:imagedata src=\"file:\/\/\/C:\\Users\\msk\\AppData\\Local\\Temp\\msohtmlclip1\\01\\clip_image007.png\"\no:title=\"entityframework_resim4\" \/>\n<\/v:shape><![endif]--><!--[if !vml]--><img decoding=\"async\" loading=\"lazy\" width=\"451\" height=\"659\" v:shapes=\"Picture_x0020_5\" alt=\"\" src=\"\/yuklenendosyalar\/image\/sabri\/entity1\/entityframework_resim4.jpg\" \/><!--[endif]--><\/span><\/p>\n<p class=\"MsoNormal\">&Ouml;rnegimizde AdventureWorks veritabanini kullaniyoruz.<\/p>\n<p class=\"MsoNormal\"><span style=\"mso-fareast-language:TR;mso-no-proof:yes\"><!--[if gte vml 1]><v:shape\nid=\"Picture_x0020_6\" o:spid=\"_x0000_i1028\" type=\"#_x0000_t75\" style='width:453.75pt;\nheight:403.5pt;visibility:visible;mso-wrap-style:square'>\n<v:imagedata src=\"file:\/\/\/C:\\Users\\msk\\AppData\\Local\\Temp\\msohtmlclip1\\01\\clip_image009.png\"\no:title=\"entityframework_resim5\" \/>\n<\/v:shape><![endif]--><!--[if !vml]--><img decoding=\"async\" loading=\"lazy\" width=\"605\" height=\"538\" v:shapes=\"Picture_x0020_6\" alt=\"\" src=\"\/yuklenendosyalar\/image\/sabri\/entity1\/entityframework_resim5.jpg\" \/><!--[endif]--><\/span><\/p>\n<p class=\"MsoNormal\">Baglanti ayarlarimiz yaptigimiz zaman yukaridaki ekranda bu baglanti bilgisi i&ccedil;in web.config dosyasinda kullanilacak ismi belirleyip next diyoruz.<\/p>\n<p class=\"MsoNormal\"><span style=\"mso-fareast-language:TR;mso-no-proof:yes\"><!--[if gte vml 1]><v:shape\nid=\"Picture_x0020_7\" o:spid=\"_x0000_i1027\" type=\"#_x0000_t75\" style='width:453.75pt;\nheight:403.5pt;visibility:visible;mso-wrap-style:square'>\n<v:imagedata src=\"file:\/\/\/C:\\Users\\msk\\AppData\\Local\\Temp\\msohtmlclip1\\01\\clip_image011.png\"\no:title=\"entityframework_resim6\" \/>\n<\/v:shape><![endif]--><!--[if !vml]--><img decoding=\"async\" loading=\"lazy\" width=\"605\" height=\"538\" v:shapes=\"Picture_x0020_7\" alt=\"\" src=\"\/yuklenendosyalar\/image\/sabri\/entity1\/entityframework_resim6.jpg\" \/><!--[endif]--><\/span><\/p>\n<p class=\"MsoNormal\">Gelen yukaridaki ekranda &ldquo;Tables&rdquo; sekmesini se&ccedil;ip kullanacagimiz tablolari se&ccedil;iyoruz. Biz &ouml;rnegimizde Product , productCategory ve productSubCategory tablolarini kullaniyoruz. Bu adimda Finish dedigimiz zaman modelimiz kullanilmaya hazir hale gelecek. Modelimizin g&ouml;r&uuml;nt&uuml;s&uuml; asagidaki gibi olacaktir.<\/p>\n<p class=\"MsoNormal\"><o:p>&nbsp;<\/o:p><\/p>\n<p class=\"MsoNormal\"><span style=\"mso-fareast-language:TR;mso-no-proof:yes\"><!--[if gte vml 1]><v:shape\nid=\"Picture_x0020_8\" o:spid=\"_x0000_i1026\" type=\"#_x0000_t75\" style='width:453.75pt;\nheight:384pt;visibility:visible;mso-wrap-style:square'>\n<v:imagedata src=\"file:\/\/\/C:\\Users\\msk\\AppData\\Local\\Temp\\msohtmlclip1\\01\\clip_image013.png\"\no:title=\"entityframework_resim7\" \/>\n<\/v:shape><![endif]--><!--[if !vml]--><img decoding=\"async\" loading=\"lazy\" width=\"605\" height=\"512\" v:shapes=\"Picture_x0020_8\" alt=\"\" src=\"\/yuklenendosyalar\/image\/sabri\/entity1\/entityframework_resim7.jpg\" \/><!--[endif]--><\/span><\/p>\n<p class=\"MsoNormal\"><o:p>&nbsp;<\/o:p><\/p>\n<p class=\"MsoNormal\">Simdi gelelim bu modeli kullanarak veritabanindan nasil veri &ccedil;ekecegimize.<\/p>\n<p class=\"MsoNormal\">Default.aspx sayfasina bir iki adet dropdownlist ve bir adette gridview ekleyelim. Sayfamizin html kismi asagidaki gibi olacak.<\/p>\n<table class=\"MsoTableGrid\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\" style=\"margin-left:9.9pt;background:#EEECE1;mso-background-themecolor:background2;\n    border-collapse:collapse;border:none;mso-border-alt:solid windowtext .5pt;\n    mso-yfti-tbllook:1184;mso-padding-alt:0in 5.4pt 0in 5.4pt\">\n    <tbody>\n        <tr style=\"mso-yfti-irow:0;mso-yfti-firstrow:yes;mso-yfti-lastrow:yes\">\n            <td width=\"588\" valign=\"top\" style=\"width:441.0pt;border:solid windowtext 1.0pt;\n            mso-border-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt\">\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;color:blue;mso-no-proof:\n            yes\">&lt;<\/span><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;\n            color:#A31515;mso-no-proof:yes\">table<\/span><span style=\"font-size:9.0pt;\n            font-family:&quot;Courier New&quot;;color:blue;mso-no-proof:yes\">&gt;<o:p><\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp; <\/span><span style=\"color:blue\">&lt;<\/span><span style=\"color:#A31515\">tr<\/span><span style=\"color:blue\">&gt;<o:p><\/o:p><\/span><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"color:blue\">&lt;<\/span><span style=\"color:#A31515\">td<\/span><span style=\"color:blue\">&gt;<o:p><\/o:p><\/span><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"color:blue\">&lt;<\/span><span style=\"color:#A31515\">asp<\/span><span style=\"color:blue\">:<\/span><span style=\"color:#A31515\">DropDownList<\/span> <span style=\"color:red\">ID<\/span><span style=\"color:blue\">=&quot;KategoriDropDownList&quot;<\/span> <span style=\"color:red\">AutoPostBack<\/span><span style=\"color:blue\">=&quot;true&quot;<\/span>   <span style=\"color:red\">runat<\/span><span style=\"color:blue\">=&quot;server&quot;<\/span>   <span style=\"color:red\">OnSelectedIndexChanged<\/span><span style=\"color:blue\">=&quot;KategoriDropDownList_SelectedIndexChanged&quot;&gt;<o:p><\/o:p><\/span><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"color:blue\">&lt;\/<\/span><span style=\"color:#A31515\">asp<\/span><span style=\"color:blue\">:<\/span><span style=\"color:#A31515\">DropDownList<\/span><span style=\"color:blue\">&gt;<o:p><\/o:p><\/span><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"color:blue\">&lt;\/<\/span><span style=\"color:#A31515\">td<\/span><span style=\"color:blue\">&gt;<o:p><\/o:p><\/span><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"color:blue\">&lt;<\/span><span style=\"color:#A31515\">td<\/span><span style=\"color:blue\">&gt;<o:p><\/o:p><\/span><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"color:blue\">&lt;<\/span><span style=\"color:#A31515\">asp<\/span><span style=\"color:blue\">:<\/span><span style=\"color:#A31515\">DropDownList<\/span> <span style=\"color:red\">ID<\/span><span style=\"color:blue\">=&quot;AltKategoriDropDownList&quot;<\/span> <span style=\"color:red\">runat<\/span><span style=\"color:blue\">=&quot;server&quot;&gt;<o:p><\/o:p><\/span><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"color:blue\">&lt;\/<\/span><span style=\"color:#A31515\">asp<\/span><span style=\"color:blue\">:<\/span><span style=\"color:#A31515\">DropDownList<\/span><span style=\"color:blue\">&gt;<o:p><\/o:p><\/span><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"color:blue\">&lt;\/<\/span><span style=\"color:#A31515\">td<\/span><span style=\"color:blue\">&gt;<o:p><\/o:p><\/span><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"color:blue\">&lt;<\/span><span style=\"color:#A31515\">td<\/span><span style=\"color:blue\">&gt;<o:p><\/o:p><\/span><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"color:blue\">&lt;<\/span><span style=\"color:#A31515\">asp<\/span><span style=\"color:blue\">:<\/span><span style=\"color:#A31515\">Button<\/span> <span style=\"color:red\">ID<\/span><span style=\"color:blue\">=&quot;UrunleriGetirButton&quot;<\/span> <span style=\"color:red\">runat<\/span><span style=\"color:blue\">=&quot;server&quot;<\/span>   <span style=\"color:red\">Text<\/span><span style=\"color:blue\">=&quot;&Uuml;r&uuml;nleri   Getir&quot;<\/span> <span style=\"color:red\">OnClick<\/span><span style=\"color:blue\">=&quot;UrunleriGetirButton_Click&quot;<\/span> <span style=\"color:blue\">\/&gt;<o:p><\/o:p><\/span><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"color:blue\">&lt;\/<\/span><span style=\"color:#A31515\">td<\/span><span style=\"color:blue\">&gt;<o:p><\/o:p><\/span><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp; <\/span><span style=\"color:blue\">&lt;\/<\/span><span style=\"color:#A31515\">tr<\/span><span style=\"color:blue\">&gt;<o:p><\/o:p><\/span><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp; <\/span><span style=\"color:blue\">&lt;<\/span><span style=\"color:#A31515\">tr<\/span><span style=\"color:blue\">&gt;<o:p><\/o:p><\/span><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"color:blue\">&lt;<\/span><span style=\"color:#A31515\">td<\/span> <span style=\"color:red\">colspan<\/span><span style=\"color:blue\">=&quot;3&quot;&gt;<o:p><\/o:p><\/span><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"color:blue\">&lt;<\/span><span style=\"color:#A31515\">asp<\/span><span style=\"color:blue\">:<\/span><span style=\"color:#A31515\">GridView<\/span> <span style=\"color:red\">ID<\/span><span style=\"color:blue\">=&quot;UrunlerGridView&quot;<\/span> <span style=\"color:red\">runat<\/span><span style=\"color:blue\">=&quot;server&quot;&gt;<o:p><\/o:p><\/span><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"color:blue\">&lt;\/<\/span><span style=\"color:#A31515\">asp<\/span><span style=\"color:blue\">:<\/span><span style=\"color:#A31515\">GridView<\/span><span style=\"color:blue\">&gt;<o:p><\/o:p><\/span><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"color:blue\">&lt;\/<\/span><span style=\"color:#A31515\">td<\/span><span style=\"color:blue\">&gt;<o:p><\/o:p><\/span><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp; <\/span><span style=\"color:blue\">&lt;\/<\/span><span style=\"color:#A31515\">tr<\/span><span style=\"color:blue\">&gt;<o:p><\/o:p><\/span><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;color:blue;\n            mso-no-proof:yes\">&lt;\/<\/span><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;\n            color:#A31515;mso-no-proof:yes\">table<\/span><span style=\"font-size:9.0pt;\n            font-family:&quot;Courier New&quot;;color:blue;mso-no-proof:yes\">&gt;<\/span><\/p>\n            <\/td>\n        <\/tr>\n    <\/tbody>\n<\/table>\n<p class=\"MsoNormal\"><o:p>&nbsp;<\/o:p><\/p>\n<p class=\"MsoNormal\">Simdi ilk olarak sayfa y&uuml;klenirken kategori dropdownlistini dolduralim. Kategori se&ccedil;ilincede alt kategorileri dolduralim.<\/p>\n<p class=\"MsoNormal\">Ilk olarak kategorileri doldurmak i&ccedil;in asagidaki kodu yazin.<\/p>\n<table class=\"MsoTableGrid\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\" style=\"margin-left:9.9pt;background:#EEECE1;mso-background-themecolor:background2;\n    border-collapse:collapse;border:none;mso-border-alt:solid windowtext .5pt;\n    mso-yfti-tbllook:1184;mso-padding-alt:0in 5.4pt 0in 5.4pt;mso-border-insideh:\n    none;mso-border-insidev:none\">\n    <tbody>\n        <tr style=\"mso-yfti-irow:0;mso-yfti-firstrow:yes;mso-yfti-lastrow:yes\">\n            <td width=\"588\" valign=\"top\" style=\"width:441.0pt;border:solid windowtext 1.0pt;\n            mso-border-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt\">\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;color:blue;mso-no-proof:\n            yes\">protected<\/span><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;\n            mso-no-proof:yes\"> <span style=\"color:blue\">void<\/span> Page_Load(<span style=\"color:blue\">object<\/span> sender, <span style=\"color:#2B91AF\">EventArgs<\/span>   e)<o:p><\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\">{<o:p><\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp; <\/span><span style=\"color:blue\">if<\/span>   (!IsPostBack)<o:p><\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp; <\/span>{<o:p><\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>KategorileriGetir();<o:p><\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp; <\/span>}<o:p><\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\">}<o:p><\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><o:p>&nbsp;<\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;color:blue;mso-no-proof:\n            yes\">private<\/span><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;\n            mso-no-proof:yes\"> <span style=\"color:blue\">void<\/span> KategorileriGetir()<o:p><\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\">{<o:p><\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp; <\/span><span style=\"color:#2B91AF\">DemoEntities<\/span>   entity = <span style=\"color:blue\">new<\/span> <span style=\"color:#2B91AF\">DemoEntities<\/span>();<o:p><\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp; <\/span><span style=\"color:#2B91AF\">List<\/span>&lt;<span style=\"color:#2B91AF\">DimProductCategory<\/span>&gt; kategoriList =   entity.DimProductCategory.ToList();<o:p><\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp; <\/span>KategoriDropDownList.DataSource =   kategoriList;<o:p><\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp; <\/span>KategoriDropDownList.DataValueField = <span style=\"color:#A31515\">&quot;ProductCategoryKey&quot;<\/span>;<o:p><\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp; <\/span>KategoriDropDownList.DataTextField = <span style=\"color:#A31515\">&quot;EnglishProductCategoryName&quot;<\/span>;<o:p><\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp; <\/span>KategoriDropDownList.DataBind();<o:p><\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><o:p>&nbsp;<\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><o:p>&nbsp;<\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:\n            yes\">}<\/span><\/p>\n            <\/td>\n        <\/tr>\n    <\/tbody>\n<\/table>\n<p class=\"MsoNormal\"><o:p>&nbsp;<\/o:p><\/p>\n<p class=\"MsoNormal\">Ikinci olarak kategori se&ccedil;ildigi zaman asagidaki kodu yazarak alt kategorileri dolduralim.<\/p>\n<table class=\"MsoTableGrid\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\" style=\"margin-left:9.9pt;background:#EEECE1;mso-background-themecolor:background2;\n    border-collapse:collapse;border:none;mso-border-alt:solid windowtext .5pt;\n    mso-yfti-tbllook:1184;mso-padding-alt:0in 5.4pt 0in 5.4pt;mso-border-insideh:\n    none;mso-border-insidev:none\">\n    <tbody>\n        <tr style=\"mso-yfti-irow:0;mso-yfti-firstrow:yes;mso-yfti-lastrow:yes\">\n            <td width=\"588\" valign=\"top\" style=\"width:441.0pt;border:solid windowtext 1.0pt;\n            mso-border-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt\">\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;color:blue;mso-no-proof:\n            yes\">protected<\/span><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;\n            mso-no-proof:yes\"> <span style=\"color:blue\">void<\/span>   KategoriDropDownList_SelectedIndexChanged(<span style=\"color:blue\">object<\/span>   sender, <span style=\"color:#2B91AF\">EventArgs<\/span> e)<o:p><\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\">{<o:p><\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp; <\/span><span style=\"color:blue\">int<\/span>   KategoriKey = <span style=\"color:#2B91AF\">Int32<\/span>.Parse(KategoriDropDownList.SelectedValue);<o:p><\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp; <\/span><span style=\"color:#2B91AF\">DemoEntities<\/span>   entity = <span style=\"color:blue\">new<\/span> <span style=\"color:#2B91AF\">DemoEntities<\/span>();<o:p><\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><o:p>&nbsp;<\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp; <\/span><span style=\"color:blue\">var<\/span> query   = <span style=\"color:blue\">from<\/span> c <span style=\"color:blue\">in<\/span>   entity.DimProductSubcategory<o:p><\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"color:blue\">where<\/span>   c.DimProductCategory.ProductCategoryKey == KategoriKey<o:p><\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"color:blue\">select<\/span>   c;<o:p><\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quotquot;;mso-no-proof:yes\"><o:p>&nbsp;<\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp; <\/span>AltKategoriDropDownList.DataSource =   query.ToList(); ;<o:p><\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp; <\/span>AltKategoriDropDownList.DataValueField = <span style=\"color:#A31515\">&quot;ProductSubcategoryKey&quot;<\/span>;<o:p><\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp; <\/span>AltKategoriDropDownList.DataTextField = <span style=\"color:#A31515\">&quot;EnglishProductSubcategoryName&quot;<\/span>;<o:p><\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp; <\/span>AltKategoriDropDownList.DataBind();<o:p><\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:\n            yes\">}<\/span><\/p>\n            <\/td>\n        <\/tr>\n    <\/tbody>\n<\/table>\n<p class=\"MsoNormal\"><o:p>&nbsp;<\/o:p><\/p>\n<p class=\"MsoNormal\">Yukaridaki adimlari tamamladigimiz zaman kategori ve alt kategori alanlari ile olan islemimiz bitmis oluyor. Simdi ise &uuml;r&uuml;nleri getir butonuna basinca se&ccedil;ilen kategorideki &uuml;r&uuml;nleri alip gridview i&ccedil;ine atalim.<\/p>\n<table class=\"MsoTableGrid\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\" style=\"margin-left:9.9pt;background:#EEECE1;mso-background-themecolor:background2;\n    border-collapse:collapse;border:none;mso-border-alt:solid windowtext .5pt;\n    mso-yfti-tbllook:1184;mso-padding-alt:0in 5.4pt 0in 5.4pt;mso-border-insideh:\n    none;mso-border-insidev:none\">\n    <tbody>\n        <tr style=\"mso-yfti-irow:0;mso-yfti-firstrow:yes;mso-yfti-lastrow:yes\">\n            <td width=\"588\" valign=\"top\" style=\"width:441.0pt;border:solid windowtext 1.0pt;\n            mso-border-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt\">\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;color:blue;mso-no-proof:\n            yes\">protected<\/span><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;\n            mso-no-proof:yes\"> <span style=\"color:blue\">void<\/span>   UrunleriGetirButton_Click(<span style=\"color:blue\">object<\/span> sender, <span style=\"color:#2B91AF\">EventArgs<\/span> e)<o:p><\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\">{<o:p><\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp; <\/span><span style=\"color:blue\">int<\/span>   AltKategoriKey = <span style=\"color:#2B91AF\">Int32<\/span>.Parse(AltKategoriDropDownList.SelectedValue);<o:p><\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp; <\/span><span style=\"color:#2B91AF\">DemoEntities<\/span>   entity = <span style=\"color:blue\">new<\/span> <span style=\"color:#2B91AF\">DemoEntities<\/span>();<o:p><\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><o:p>&nbsp;<\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp; <\/span><span style=\"color:blue\">var<\/span> query   = <span style=\"color:blue\">from<\/span> p <span style=\"color:blue\">in<\/span>   entity.DimProduct<o:p><\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"color:blue\">where<\/span>   p.DimProductSubcategory.ProductSubcategoryKey == AltKategoriKey<o:p><\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"color:blue\">select<\/span>   <span style=\"color:blue\">new<\/span> { p.ProductKey, p.EnglishProductName,   p.Color, p.TurkishDescription };<o:p><\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><o:p>&nbsp;<\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp; <\/span>UrunlerGridView.DataSource =   query.ToList(); ;<o:p><\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal;mso-layout-grid-align:none;text-autospace:none\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes\"><span style=\"mso-spacerun:yes\">&nbsp;&nbsp;&nbsp; <\/span>UrunlerGridView.DataBind();<o:p><\/o:p><\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin-bottom:0in;margin-bottom:.0001pt;line-height:\n            normal\"><span style=\"font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:\n            yes\">}<\/span><\/p>\n            <\/td>\n        <\/tr>\n    <\/tbody>\n<\/table>\n<p class=\"MsoNormal\"><o:p>&nbsp;<\/o:p><\/p>\n<p class=\"MsoNormal\">Yukaridaki kodu inceleyecek olursaniz product tablosunda sadece istedigimiz kolonlari getirdik, bunun i&ccedil;inde new deyip yeni bir tanimlama yaptik.<br \/>\n<a href='www.yazilimmutfagi.com'>.<\/a><\/p>\n<p class=\"MsoNormal\">Sonu&ccedil; olarak islemlerin sonucunda asagidaki gibi bir ekran &ccedil;iktimiz oldu.<\/p>\n<p class=\"MsoNormal\"><span style=\"mso-fareast-language:TR;mso-no-proof:yes\"><!--[if gte vml 1]><v:shape\nid=\"Picture_x0020_9\" o:spid=\"_x0000_i1025\" type=\"#_x0000_t75\" style='width:453pt;\nheight:287.25pt;visibility:visible;mso-wrap-style:square'>\n<v:imagedata src=\"file:\/\/\/C:\\Users\\msk\\AppData\\Local\\Temp\\msohtmlclip1\\01\\clip_image015.png\"\no:title=\"entityframework_resim8\" \/>\n<\/v:shape><![endif]--><!--[if !vml]--><img decoding=\"async\" loading=\"lazy\" width=\"604\" height=\"383\" v:shapes=\"Picture_x0020_9\" alt=\"\" src=\"\/yuklenendosyalar\/image\/sabri\/entity1\/entityframework_resim8.jpg\" \/><!--[endif]--><\/span><\/p>\n<p class=\"MsoNormal\"><o:p>&nbsp;<\/o:p><\/p>","protected":false},"excerpt":{"rendered":"<p>Bu makalemizde Microsoftun ORM ara&#231;larindan Entity Framework yapisini kullanarak bir data modeli olusturacagiz ve bu model ile veritabanindan nasil select islemi yapacagimizi &#246;grenecegiz.<\/p>\n","protected":false},"author":517,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[434],"tags":[6047,4434,4341,5178,5681,5745,5091],"_links":{"self":[{"href":"https:\/\/www.yazilimmutfagi.com\/index.php\/wp-json\/wp\/v2\/posts\/151"}],"collection":[{"href":"https:\/\/www.yazilimmutfagi.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yazilimmutfagi.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yazilimmutfagi.com\/index.php\/wp-json\/wp\/v2\/users\/517"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yazilimmutfagi.com\/index.php\/wp-json\/wp\/v2\/comments?post=151"}],"version-history":[{"count":0,"href":"https:\/\/www.yazilimmutfagi.com\/index.php\/wp-json\/wp\/v2\/posts\/151\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yazilimmutfagi.com\/index.php\/wp-json\/wp\/v2\/media?parent=151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yazilimmutfagi.com\/index.php\/wp-json\/wp\/v2\/categories?post=151"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yazilimmutfagi.com\/index.php\/wp-json\/wp\/v2\/tags?post=151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}