{"id":720,"date":"2012-11-07T20:18:44","date_gmt":"2012-11-07T12:18:44","guid":{"rendered":"http:\/\/www.vcoo.cc\/blog\/?p=720"},"modified":"2012-11-07T20:18:44","modified_gmt":"2012-11-07T12:18:44","slug":"csharp-datarow-new","status":"publish","type":"post","link":"https:\/\/vcoo.cc\/blog\/720\/","title":{"rendered":"C#\u4e2dDataRow\u7684\u5b9e\u4f8b\u5316\u95ee\u9898"},"content":{"rendered":"<p>\u521d\u5b66dotNet\u7f16\u7a0b\uff0c\u9047\u5230\u95ee\u9898\u5404\u79cd\uff0c\u6700\u8fd1\u5728\u7814\u7a76DataTable\u7b49\u9047\u5230DataRow\u5b9e\u4f8b\u5316\u7684\u95ee\u9898\uff0c\u5f88\u81ea\u7136\u7684\u8fd9\u6837\u5b9e\u4f8b\u5316\u4e00\u4e2aDataRow\uff1a<\/p>\n<p>[csharp]DataTable dt = new DataTable();<br \/>\n&#8230;<br \/>\ndt.Column.Add(&quot;C1&quot;);<br \/>\ndt.Column.Add(&quot;C2&quot;);<br \/>\n&#8230;<br \/>\nDataRow dr = dt.NewRow();<br \/>\n[\/csharp]<\/p>\n<p>\u4e8e\u662f\u51fa\u73b0\u4e0b\u9762\u7684\u9519\u8bef\uff1a<\/p>\n<blockquote><p>\u201cSystem.Data.DataRow.DataRow(System.Data.DataRowBuilder)\u201d\u4e0d\u53ef\u8bbf\u95ee\uff0c\u56e0\u4e3a\u5b83\u53d7\u4fdd\u62a4\u7ea7\u522b\u9650\u5236\u3002<\/p><\/blockquote>\n<p>\u8f6c\u5230\u5b9a\u4e49\uff0c\u4f1a\u53d1\u73b0\u5728DataRow \u7c7b\u7684\u58f0\u660e\u7684\u5730\u65b9\u7528\u4e86protected\u5173\u952e\u5b57\u3002\u4ed6\u662f\u4e00\u4e2a\u53d7\u4fdd\u62a4\u7684internal\u7c7b\u3002internal \u5173\u952e\u5b57\u662f\u7c7b\u578b\u548c\u7c7b\u578b\u6210\u5458\u7684\u8bbf\u95ee\u4fee\u9970\u7b26\u3002\u53ea\u6709\u5728\u540c\u4e00\u7a0b\u5e8f\u96c6\u7684\u6587\u4ef6\u4e2d\uff0c\u5185\u90e8\u7c7b\u578b\u6216\u6210\u5458\u624d\u662f\u53ef\u8bbf\u95ee\u7684\u3002<\/p>\n<p><strong>MS\u8fd9\u4e48\u505a\u662f\u6709\u4ed6\u7684\u9690\u542b\u610f\u601d\u5728\u91cc\u9762\u7684\uff1a<\/strong><\/p>\n<p><strong>\u4e00\u3001<\/strong>\u4e00\u4e2atable\u548c\u4ed6\u5bf9\u5e94\u7684row\u5e94\u8be5\u662f\u6709\u76f8\u540c\u7ed3\u6784\u7684,\u4e3a\u4e86\u4fdd\u8bc1\u4ed6\u4eec\u7ed3\u6784\u76f8\u540c,\u5c31\u5fc5\u987b\u6309\u7167\u4e00\u4e2a\u7edf\u4e00\u6807\u51c6\u6765\u89c4\u8303\u4ed6\u4eec.\u8981\u4e48\u7528table\u6765\u89c4\u8303row,\u90a3\u4e48\u8ba9row\u53bb\u683c\u5f0f\u5316table,ms\u9009\u62e9\u4e86\u524d\u4e00\u79cd\u65b9\u5f0f,\u8fd9\u91cc\u4ed6\u4eec\u53c8\u9690\u542b\u4e00\u5c42\u610f\u601d,\u90a3\u5c31\u662f\u751f\u6210\u7684\u987a\u5e8f,table\u6bd4row\u5148\u751f\u6210.<\/p>\n<p>\u6240\u4ee5\u4e3a\u4e86\u4e25\u683c\u4fdd\u8bc1\u8fd9\u79cd\u89c4\u8303\u548c\u751f\u6210\u987a\u5e8f,\u8be5\u6784\u9020\u51fd\u6570\u5c31\u9650\u5236\u6210\u4e86protected internal ,ok\u4e86,\u8fd9\u4e48\u505a,\u4f60\u5c31\u662f\u60f3\u628atable\u548crow\u7ed3\u6784\u4e0d\u5bf9\u5e94\u90fd\u4e0d\u6210\u4e86,\u56e0\u4e3a\u4ed6\u6ca1\u6709\u7559\u7ed9\u4f60\u4efb\u4f55\u72af\u9519\u7684\u673a\u4f1a<\/p>\n<p><strong>\u4e8c\u3001<\/strong>\u4ece\u4e0a\u9762\u7684\u6784\u9020\u51fd\u6570\u53ef\u4ee5\u770b\u51fa,\u5b9e\u9645\u4e0arow\u7ed3\u6784\u7684\u521b\u5efa\u662fDataRowBuilder\u7c7b\u8d1f\u8d23\u7684,\u800c\u4e0d\u662fdatarow\u7c7b,datarow\u7c7b\u5b9e\u9645\u8d1f\u8d23\u5bf9row\u7684\u64cd\u4f5c\u800c\u4e0d\u662f\u521b\u5efa\u3002<\/p>\n<p><em>\u6ce8\uff1a\u90e8\u5206\u5185\u5bb9\u8f6c\u81ea\u7f51\u7edc<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u521d\u5b66dotNet\u7f16\u7a0b\uff0c\u9047\u5230\u95ee\u9898\u5404\u79cd\uff0c\u6700\u8fd1\u5728\u7814\u7a76DataTable\u7b49\u9047\u5230DataRow\u5b9e\u4f8b\u5316\u7684\u95ee\u9898\uff0c\u5f88\u81ea\u7136\u7684\u8fd9\u6837\u5b9e\u4f8b\u5316\u4e00\u4e2aDataRow\uff1a<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[195,224,201,51],"class_list":["post-720","post","type-post","status-publish","format-standard","hentry","category-csharp","tag-csharp-2","tag-datarow","tag-dotnet","tag-51","cat-13-id"],"_links":{"self":[{"href":"https:\/\/vcoo.cc\/blog\/wp-json\/wp\/v2\/posts\/720","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vcoo.cc\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vcoo.cc\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vcoo.cc\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vcoo.cc\/blog\/wp-json\/wp\/v2\/comments?post=720"}],"version-history":[{"count":0,"href":"https:\/\/vcoo.cc\/blog\/wp-json\/wp\/v2\/posts\/720\/revisions"}],"wp:attachment":[{"href":"https:\/\/vcoo.cc\/blog\/wp-json\/wp\/v2\/media?parent=720"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vcoo.cc\/blog\/wp-json\/wp\/v2\/categories?post=720"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vcoo.cc\/blog\/wp-json\/wp\/v2\/tags?post=720"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}