{"id":98,"date":"2010-05-10T08:00:00","date_gmt":"2010-05-10T00:00:00","guid":{"rendered":"http:\/\/31.0.2.219:81\/?p=98"},"modified":"2014-03-11T14:04:16","modified_gmt":"2014-03-11T06:04:16","slug":"vbdatagrid1%e7%9a%84%e5%ba%94%e7%94%a8","status":"publish","type":"post","link":"http:\/\/www.huike007.cn\/?p=98","title":{"rendered":"VB+Datagrid1\u7684\u5e94\u7528"},"content":{"rendered":"<p>1. TEXT\u4e2d\u663e\u793aDatagrid\u9009\u4e2d\u7684\u5185\u5bb9<br \/>\n        Private Sub DataGrid1_Click()<br \/>\n             Text1.Text = Adodc1.Recordset.Fields(0)  &#39;(0)\u8868\u793a\u7b2c1\u5b57\u6bb5\uff0c&#8230;\u4ee5\u6b64\u7c7b\u63a8<br \/>\n             Text2.Text = Adodc1.Recordset.Fields(1)<\/p>\n<p>            End Sub<br \/>\n2. TEXT\u4e2d\u663e\u793aDatagrid\u6240\u9009\u4e2d\u7684\u884c\u6570<\/p>\n<p>        Private Sub DataGrid1_Click()<br \/>\n             Text1.Text = DataGrid1.Row<br \/>\n            End Sub<br \/>\n          \u5c06\u5f53\u524d\u9009\u5b9a(\u5149\u6807\u6240\u5728)\u7684DataGrid1\u884c\u6570\u8fd4\u56de\u7ed9Text<br \/>\n3. Datagrid1\u663e\u793a\u6570\u636e\u5e93\u5185\u5bb9<br \/>\n     \u5efa\u4e2a Adodc1\uff0c\u5c5e\u6027\u8bbe\u7f6e\u597d\u6570\u636e\u5e93\u7684\u8fde\u63a5<br \/>\n     adodc1\u7684\u5c5e\u6027\uff0ccommandtype \u8bbe\u7f6e\u4e3a adcmdtext<br \/>\n        Private Sub Command1_Click()<br \/>\n            Adodc1.RecordSource = &#34;sel&#101;ct * from a wh&#101;re id = 10&#34;<br \/>\n            Adodc1.Refresh<\/p>\n<p>           Set DataGrid1.DataSource = Adodc1<br \/>\n            End Sub<br \/>\n4. \u7edf\u8ba1\u8868\u4e2d\u8bb0\u5f55\u7684\u4e2a\u6570<br \/>\n       Private Sub Command1_Click()<br \/>\n            Adodc1.Caption = &#34;\u5171&#34; &amp; DataGrid1.ApproxCount &amp; &#34;\u6761\u8bb0\u5f55&#34;<br \/>\n          End Sub<br \/>\n             DataGrid1.ApproxCount          \u5f97\u5230\u6240\u6709\u884c\u6570<br \/>\n             DataGrid1.Columns.Count       \u8fd4\u56de\u5217\u6570<br \/>\n             DataGrid1.Row                         \u7528\u6237\u9009\u62e9\u7684\u884c\u6570<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. TEXT\u4e2d\u663e\u793aDatagrid\u9009\u4e2d\u7684\u5185\u5bb9 Private Sub DataGrid1_Click() T [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[181],"tags":[252],"_links":{"self":[{"href":"http:\/\/www.huike007.cn\/index.php?rest_route=\/wp\/v2\/posts\/98"}],"collection":[{"href":"http:\/\/www.huike007.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.huike007.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.huike007.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.huike007.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=98"}],"version-history":[{"count":1,"href":"http:\/\/www.huike007.cn\/index.php?rest_route=\/wp\/v2\/posts\/98\/revisions"}],"predecessor-version":[{"id":251,"href":"http:\/\/www.huike007.cn\/index.php?rest_route=\/wp\/v2\/posts\/98\/revisions\/251"}],"wp:attachment":[{"href":"http:\/\/www.huike007.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=98"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.huike007.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=98"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.huike007.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=98"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}