{"id":7,"date":"2006-04-01T06:36:51","date_gmt":"2006-04-01T06:36:51","guid":{"rendered":"http:\/\/blog.jason695.idv.tw:81\/wordpress\/?p=7"},"modified":"2006-04-01T06:36:51","modified_gmt":"2006-04-01T06:36:51","slug":"what-is-datarelation","status":"publish","type":"post","link":"https:\/\/jason695.why3s.tw\/wordpress\/2006\/04\/01\/what-is-datarelation\/","title":{"rendered":"What is DataRelation??"},"content":{"rendered":"<p>\u5728ASP.NET\u4e2d\u5c0d\u65bc\u8cc7\u6599\u7684\u8655\u7406,<br \/>\n\u7531\u65bcDataSet\u7684\u51fa\u73fe,<br \/>\n\u4f7f\u5f97\u8cc7\u6599\u9593\u7684\u95dc\u806f\u4e0d\u518d\u53ea\u4f9d\u8cf4SQL\u7684\u8a9e\u6cd5,<br \/>\n\u800c\u53ef\u6539\u7528DataRelation.<\/p>\n<p>DataRelation\u7684\u7528\u6cd5,\u540c\u95dc\u806f\u5f0f\u8cc7\u6599\u5eab,<br \/>\n\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 \/>\n\u800c\u9019\u4e9bDataTable\u5c31\u53ef\u4ee5\u9760\u8457DataRelation\u9023\u7e6b\u5728\u4e00\u8d77,<br \/>\n\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 \/>\nDim parentCol as Datacolumn<br \/>\nDim childCol as DataColumn<\/p>\n<p>parentCol = ds .tables(&#8220;customers&#8221;).columns(&#8220;customerID&#8221;)<br \/>\nchildCol = ds.tables(&#8220;orders&#8221;).columns(&#8220;customerID&#8221;)<br \/>\ndr = New DataRelation(&#8220;custorders&#8221;,parentCol,childCol)<br \/>\nds.Relations.Add(dr) <\/p>\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 &hellip; <a href=\"https:\/\/jason695.why3s.tw\/wordpress\/2006\/04\/01\/what-is-datarelation\/\" 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":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[2],"tags":[],"class_list":["post-7","post","type-post","status-publish","format-standard","hentry","category-net","no-featured-image"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/posts\/7","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=7"}],"version-history":[{"count":0,"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/posts\/7\/revisions"}],"wp:attachment":[{"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/media?parent=7"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/categories?post=7"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/tags?post=7"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}