{"id":1482,"date":"2005-05-11T12:46:41","date_gmt":"2005-05-11T04:46:41","guid":{"rendered":"http:\/\/jason6956.wordpress.com\/2005\/05\/11\/what-is-datarelation"},"modified":"2010-10-06T21:12:16","modified_gmt":"2010-10-06T13:12:16","slug":"what-is-datarelation-2","status":"publish","type":"post","link":"https:\/\/jason695.why3s.tw\/wordpress\/2005\/05\/11\/what-is-datarelation-2\/","title":{"rendered":"What is DataRelation??"},"content":{"rendered":"<div id=\"msgcns!1BF4A629EA6C6E8E!263\" class=\"bvMsg\">\n<p>\u5728ASP.NET\u4e2d\u5c0d\u65bc\u8cc7\u6599\u7684\u8655\u7406,<br \/>\u7531\u65bcDataSet\u7684\u51fa\u73fe,<br \/>\u4f7f\u5f97\u8cc7\u6599\u9593\u7684\u95dc\u806f\u4e0d\u518d\u53ea\u4f9d\u8cf4SQL\u7684\u8a9e\u6cd5,<br \/>\u800c\u53ef\u6539\u7528DataRelation.<\/p>\n<p>DataRelation\u7684\u7528\u6cd5,\u540c\u95dc\u806f\u5f0f\u8cc7\u6599\u5eab,<br \/>\u610f\u5373\u4e8c\u500b\u4e0d\u540c\u7684Table,\u7528key(\u6b04\u4f4d)\u9032\u884c\u4e00\u5c0d\u591a\u7684\u95dc\u806f.<\/p>\n<p>\u5728DataSet\u4e2d\u53ef\u5bb9\u7d0d\u591a\u500bDataTable,<br \/>\u800c\u9019\u4e9bDataTable\u5c31\u53ef\u4ee5\u9760\u8457DataRelation\u9023\u7e6b\u5728\u4e00\u8d77,<br \/>\u5f8c\u7e8c\u5c31\u53ef\u4ee5\u85c9\u8457DataView OR DataReader\u628a\u8cc7\u6599DataBind\u9032\u53bb<\/p>\n<p>\u8a9e\u6cd5\u5982\u4e0b\uff1a<\/p>\n<p>Dim dr as DataRelation<br \/>Dim\u00a0parentCol as Datacolumn<br \/>Dim childCol as DataColumn<\/p>\n<p>parentCol = ds .tables(&quot;customers&quot;).columns(&quot;customerID&quot;)<br \/>childCol = ds.tables(&quot;orders&quot;).columns(&quot;customerID&quot;)<br \/>dr = New DataRelation(&quot;custorders&quot;,parentCol,childCol)<br \/>ds.Relations.Add(dr)\u00a0<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u5728ASP.NET\u4e2d\u5c0d\u65bc\u8cc7\u6599\u7684\u8655\u7406,\u7531\u65bcDataSet\u7684\u51fa\u73fe,\u4f7f\u5f97\u8cc7\u6599\u9593\u7684\u95dc\u806f\u4e0d\u518d\u53ea\u4f9d\u8cf4SQL\u7684\u8a9e\u6cd5,\u800c\u53ef\u6539\u7528D &hellip; <a href=\"https:\/\/jason695.why3s.tw\/wordpress\/2005\/05\/11\/what-is-datarelation-2\/\" class=\"more-link\">\u95b1\u8b80\u5168\u6587 <span class=\"screen-reader-text\">What is DataRelation??<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[29],"tags":[],"class_list":["post-1482","post","type-post","status-publish","format-standard","hentry","category-29","no-featured-image"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/posts\/1482","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/comments?post=1482"}],"version-history":[{"count":0,"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/posts\/1482\/revisions"}],"wp:attachment":[{"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/media?parent=1482"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/categories?post=1482"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/tags?post=1482"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}