{"id":29,"date":"2014-05-14T00:42:00","date_gmt":"2014-05-13T15:42:00","guid":{"rendered":"http:\/\/the-takeo.expressweb.jp\/?p=29"},"modified":"2014-11-15T13:10:17","modified_gmt":"2014-11-15T04:10:17","slug":"datatable%e3%81%aefind%e3%83%a1%e3%82%bd%e3%83%83%e3%83%89","status":"publish","type":"post","link":"http:\/\/the-takeo.com\/?p=29","title":{"rendered":"DataTable\u306eFind\u30e1\u30bd\u30c3\u30c9"},"content":{"rendered":"<p>\u4ed5\u4e8b\u4e0a\u3001.Net\u306eDataTable\u3092\u3088\u304f\u89e6\u308b\u3002<br \/>\n\u4e3b\u30ad\u30fc\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u306fFind\u30e1\u30bd\u30c3\u30c9\u3055\u3093\u3092\u4f7f\u3048\u3070\u76ee\u7684\u306e\u884c\u3092\u53d6\u308a\u51fa\u305b\u308b\u3002<\/p>\n<pre class=\"lang:c# decode:true \" >DataTable dt = new DataTable();\r\ndt.Columns.Add(\"col1\");\r\ndt.Columns.Add(\"col2\");\r\ndt.PrimaryKey = DataColumn[] { dt.Columns[0] };\r\n\r\nfor (int i = 0; i < 10; i++)\r\n{\r\n\tDataRow dr = dt.NewRow();\r\n\tdr[\"col1\"] = i.ToString();\r\n\tdr[\"col2\"] = i.ToString()+\"\u56de\u76ee\u306b\u8ffd\u52a0\u3055\u308c\u305f\u884c\u3067\u3059\u3002\";\r\n\tdt.Rows.Add(dr);\r\n}\r\n\/\/\u3053\u3053\u307e\u3067DataTable\u3092\u4f5c\u6210\u3057\u3066\u3044\u308b\u3060\u3051\r\n\r\nDataRow findDr = dt.Rows.Find(\"5\");\r\nConsole.WriteLine(findDr[\"col2\"].ToString());<\/pre>\n<p>\u4e0a\u8a18\u306f\u4e3b\u30ad\u30fc\u304c\"5\"\u3067\u3042\u308b\u884c\u3092\u53d6\u5f97\u3057\u3066\u3044\u308b\u3002<\/p>\n<p>\u3067\u3001\u3053\u306eFind\u30e1\u30bd\u30c3\u30c9\u3060\u3051\u3069\u3001\u3069\u3046\u3084\u3089\u5f15\u6570\u306e\u672b\u5c3e\u306e\u30b9\u30da\u30fc\u30b9\u306f\u8003\u616e\u3057\u306a\u3044\u3089\u3057\u3044\u3002<br \/>\n\u3064\u307e\u308a\u3001<br \/>\n<b>dt.Rows.Find(\"5\")\u3068<br \/>\ndt.Rows.Find(\"5 \")<\/b>\u306f\u540c\u3058\u7d50\u679c\u306b\u306a\u3063\u3066\u3057\u307e\u3046\u3002<br \/>\n\u56de\u907f\u65b9\u6cd5\u306f\u4eca\u306e\u3068\u3053\u308d\u4e0d\u660e\u3002<br \/>\nDatatable\u306eSelect\u30e1\u30bd\u30c3\u30c9\u3082\u540c\u69d8\u3067\u3057\u305f\u3002<br \/>\nDataTable\u306e\u60c5\u5831\u306b\u306f\u672b\u5c3e\u7a7a\u767d\u306e\u3082\u306e\u3092\u6301\u305f\u3055\u306a\u3044\u3088\u3046\u306b\u5de5\u592b\u3059\u3079\u304d\u306a\u306e\u304b\u306a\u3002<\/p>\n<p>\u4eca\u65e5\u306e\u4ed5\u4e8b\u3067\u3053\u3053\u3067\u4e00\u77ac\u8a70\u307e\u3063\u305f\u3002<br \/>\n\u30b3\u30fc\u30c9\u773a\u3081\u308b\u3068\u4f55\u306e\u554f\u984c\u3082\u306a\u3055\u305d\u3046\u3060\u3057\u3002<br \/>\n\u30c7\u30d0\u30c3\u30b0\u3057\u305f\u3089\u3059\u3050\u306b\u304a\u304b\u3057\u3044\u3053\u3068\u306b\u6c17\u304c\u3064\u3044\u305f\u3051\u3069\u3001<br \/>\n\u3053\u308c\u306f\u5b9f\u88c5\u4e2d\u306f\u6c17\u4ed8\u304b\u306a\u3044\u306a\u3041\u3002<\/p>\n<p>\u8abf\u3079\u3066\u307f\u305f\u3051\u3069\u3042\u3093\u307e\u308a\u6587\u732e\u304c\u306a\u304b\u3063\u305f\u3002\u5e38\u8b58\u306a\u306e\u304b\u306a\u3002<br \/>\n\u305d\u3046\u3044\u3048\u3070SQL\u306ewhere\u53e5\u3067\u3082\u4f3c\u305f\u3088\u3046\u306a\u3053\u3068\u304c\u3042\u3063\u305f\u6c17\u304c\u3059\u308b\u3002<br \/>\n\u3042\u3093\u307e\u308a\u899a\u3048\u3066\u3044\u306a\u3044\u3051\u3069\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ed5\u4e8b\u4e0a\u3001.Net\u306eDataTable\u3092\u3088\u304f\u89e6\u308b\u3002 \u4e3b\u30ad\u30fc\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u306fFind\u30e1\u30bd\u30c3\u30c9\u3055\u3093\u3092\u4f7f\u3048\u3070\u76ee\u7684\u306e\u884c\u3092\u53d6\u308a\u51fa\u305b\u308b\u3002 DataTable dt = new DataTable(); dt.Columns.Ad [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,4],"tags":[],"class_list":["post-29","post","type-post","status-publish","format-standard","hentry","category-c","category-programming"],"_links":{"self":[{"href":"http:\/\/the-takeo.com\/index.php?rest_route=\/wp\/v2\/posts\/29","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/the-takeo.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/the-takeo.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/the-takeo.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/the-takeo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=29"}],"version-history":[{"count":3,"href":"http:\/\/the-takeo.com\/index.php?rest_route=\/wp\/v2\/posts\/29\/revisions"}],"predecessor-version":[{"id":250,"href":"http:\/\/the-takeo.com\/index.php?rest_route=\/wp\/v2\/posts\/29\/revisions\/250"}],"wp:attachment":[{"href":"http:\/\/the-takeo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=29"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/the-takeo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=29"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/the-takeo.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=29"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}