Foxtable(狐表)用户栏目专家坐堂 → 关于XML的问题,初学,请发代码学习


  共有8062人关注过本帖树形打印复制链接

主题:关于XML的问题,初学,请发代码学习

帅哥哟,离线,有人找我吗?
hongyefor
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:二尾狐 帖子:524 积分:3676 威望:0 精华:0 注册:2012/7/27 10:28:00
关于XML的问题,初学,请发代码学习  发帖心情 Post By:2019/3/9 15:41:00 [显示全部帖子]

我有一个文件名为3100183130_19619745_0.xml,里面内容为

 

<?xml version="1.0" encoding="utf-8" ?>
<Kp>
    <Version />
    <Fpxx>
        <Zsl>1</Zsl>
        <Fpsj>
            <Fp>
                <Djh>1</Djh>
                <Gfmc />
                <Gfsh />
                <Gfyhzh />
                <Gfdzdh />
                <Bz />
                <Fhr></Fhr>
                <Skr></Skr>
                <Spbmbbh>30.0</Spbmbbh>
                <Hsbz>1</Hsbz>
                <Spxx>
                    <Sph>
                        <Xh>1</Xh>
                        <Spmc>夹克</Spmc>
                        <Ggxh>V191MN504402</Ggxh>
                        <Jldw>件</Jldw>
                        <Spbm>1040201120000000000</Spbm>
                        <Qyspbm />
                        <Syyhzcbz />
                        <Lslbz />
                        <Yhzcsm />
                        <Dj>168.10</Dj>
                        <Sl>77.0</Sl>
                        <Je>12943.97</Je>
                        <Slv>0.16</Slv>
                        <Kce>2071.03</Kce>
                    </Sph>
                    <Sph>
                        <Xh>2</Xh>
                        <Spmc>夹克</Spmc>
                        <Ggxh>V191MN504303</Ggxh>
                        <Jldw>件</Jldw>
                        <Spbm>1040201120000000000</Spbm>
                        <Qyspbm />
                        <Syyhzcbz />
                        <Lslbz />
                        <Yhzcsm />
                        <Dj>195.69</Dj>
                        <Sl>274.0</Sl>
                        <Je>53618.97</Je>
                        <Slv>0.16</Slv>
                        <Kce>8579.03</Kce>
                    </Sph>
                    <Sph>
                        <Xh>3</Xh>
                        <Spmc>夹克</Spmc>
                        <Ggxh>V191MN503903</Ggxh>
                        <Jldw>件</Jldw>
                        <Spbm>1040201120000000000</Spbm>
                        <Qyspbm />
                        <Syyhzcbz />
                        <Lslbz />
                        <Yhzcsm />
                        <Dj>232.76</Dj>
                        <Sl>123.0</Sl>
                        <Je>28629.31</Je>
                        <Slv>0.16</Slv>
                        <Kce>4580.69</Kce>
                    </Sph>
                </Spxx>
            </Fp>
        </Fpsj>
    </Fpxx>
</Kp>

我现在需要将该文件导入表A并将上面文件名3100183130_19619745_0的3100183130和19619745分别填入表A的代码列和编号列

<Xh>*</Xh>代表对应代码列和编号列的行数(不必导入) ,  <Spmc>**</Spmc>对应产品名称  ,  <Ggxh>*********</Ggxh>对应产品编号  ,  <Jldw>**</Jldw>对应产品的单位  ,  <Dj>****</Dj>对应单价 ,  <Sl>***</Sl>对应数量  ,  <Je>*****</Je>对应金额   ,   <Slv>***</Slv>对应税率   ,  <Kce>*****</Kce>对应税额 

以上如果有4个产品则将分别导入4行数据

如果该文件夹里有20个**********_*******_*则全部导入到表A

 

接下来还有一个XML文件

<?xml version="1.0" encoding="GBK"?>
<taxML cnName="增值税fa piao开具明细" xmlns="http://www.chinatax.gov.cn/dataspec/" name="slSbbtjZzsfpkjmxRequest" version="SW5001-2006" xsi:type="slSbbtjZzsfpkjmxRequest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <sbbZzsfpkjmx>
    <head>
      <publicHead>
        <nsrsbh>9131011656******N</nsrsbh>
        <nsrmc>上海公司</nsrmc>
        <tbrq>20190301</tbrq>
        <sssq>
          <rqQ>20190101</rqQ>
          <rqZ>20190331</rqZ>
        </sssq>
      </publicHead>
    </head>
    <body>
      <zyfpkjmx>
        <mxxx>
          <fpdm>3100183130</fpdm>
          <fphm>19619728</fphm>
          <kprq>20190112 13:23:04</kprq>
          <gmfnsrsbh>9131010758524048XB</gmfnsrsbh>
          <je>91120.69</je>
          <se>14579.31</se>
          <zfbz>N</zfbz>
          <xh>1</xh>
        </mxxx>
        <mxxx>
          <fpdm>3100183130</fpdm>
          <fphm>19619729</fphm>
          <kprq>20190112 13:40:57</kprq>
          <gmfnsrsbh>9131010758524048XB</gmfnsrsbh>
          <je>10224.14</je>
          <se>1635.86</se>
          <zfbz>N</zfbz>
          <xh>2</xh>
        </mxxx>
        <mxxx>
          <fpdm>3100183130</fpdm>
          <fphm>19619730</fphm>
          <kprq>20190112 13:44:35</kprq>
          <gmfnsrsbh>9131010758524048XB</gmfnsrsbh>
          <je>43943.97</je>
          <se>7031.03</se>
          <zfbz>N</zfbz>
          <xh>3</xh>
        </mxxx>
        <mxxx>
          <fpdm>3100183130</fpdm>
          <fphm>19619731</fphm>
          <kprq>20190112 13:48:52</kprq>
          <gmfnsrsbh>9131010758524048XB</gmfnsrsbh>
          <je>49645.19</je>
          <se>7943.23</se>
          <zfbz>N</zfbz>
          <xh>4</xh>
        </mxxx>
        <mxxx>
          <fpdm>3100183130</fpdm>
          <fphm>19619732</fphm>
          <kprq>20190112 13:56:46</kprq>
          <gmfnsrsbh>913101103511274843</gmfnsrsbh>
          <je>99967.24</je>
          <se>15994.76</se>
          <zfbz>N</zfbz>
          <xh>5</xh>
        </mxxx>
        <mxxx>
          <fpdm>3100183130</fpdm>
          <fphm>19619733</fphm>
          <kprq>20190112 14:01:29</kprq>
          <gmfnsrsbh>913101103511274843</gmfnsrsbh>
          <je>99853.45</je>
          <se>15976.55</se>
          <zfbz>N</zfbz>
          <xh>6</xh>
        </mxxx>
        <mxxx>
          <fpdm>3100183130</fpdm>
          <fphm>19619734</fphm>
          <kprq>20190112 14:04:37</kprq>
          <gmfnsrsbh>913101103511274843</gmfnsrsbh>
          <je>99995.69</je>
          <se>15999.31</se>
          <zfbz>N</zfbz>
          <xh>7</xh>
        </mxxx>
        <mxxx>
          <fpdm>3100183130</fpdm>
          <fphm>19619735</fphm>
          <kprq>20190112 14:07:57</kprq>
          <gmfnsrsbh>913101103511274843</gmfnsrsbh>
          <je>99894.83</je>
          <se>15983.17</se>
          <zfbz>Y</zfbz>
          <xh>8</xh>
        </mxxx>
        <mxxx>
          <fpdm>3100183130</fpdm>
          <fphm>19619736</fphm>
          <kprq>20190112 14:15:39</kprq>
          <gmfnsrsbh>913101103511274843</gmfnsrsbh>
          <je>82768.11</je>
          <se>13242.89</se>
          <zfbz>Y</zfbz>
          <xh>9</xh>
        </mxxx>
        <mxxx>
          <fpdm>3100183130</fpdm>
          <fphm>19619737</fphm>
          <kprq>20190112 14:23:46</kprq>
          <gmfnsrsbh>913101103511274843</gmfnsrsbh>
          <je>62159.48</je>
          <se>9945.52</se>
          <zfbz>N</zfbz>
          <xh>10</xh>
        </mxxx>
        <mxxx>
          <fpdm>3100183130</fpdm>
          <fphm>19619738</fphm>
          <kprq>20190112 14:24:31</kprq>
          <gmfnsrsbh>913101103511274843</gmfnsrsbh>
          <je>49073.28</je>
          <se>7851.72</se>
          <zfbz>N</zfbz>
          <xh>11</xh>
        </mxxx>
        <mxxx>
          <fpdm>3100183130</fpdm>
          <fphm>19619739</fphm>
          <kprq>20190112 14:45:42</kprq>
          <gmfnsrsbh>913101103511274843</gmfnsrsbh>
          <je>99894.83</je>
          <se>15983.17</se>
          <zfbz>N</zfbz>
          <xh>12</xh>
        </mxxx>
        <mxxx>
          <fpdm>3100183130</fpdm>
          <fphm>19619740</fphm>
          <kprq>20190112 14:49:20</kprq>
          <gmfnsrsbh>913101103511274843</gmfnsrsbh>
          <je>82768.11</je>
          <se>13242.89</se>
          <zfbz>N</zfbz>
          <xh>13</xh>
        </mxxx>
        <mxxx>
          <fpdm>3100183130</fpdm>
          <fphm>19619741</fphm>
          <kprq>20190113 10:58:54</kprq>
          <gmfnsrsbh>9131010758524048XB</gmfnsrsbh>
          <je>32745.00</je>
          <se>5239.20</se>
          <zfbz>N</zfbz>
          <xh>14</xh>
        </mxxx>
        <mxxx>
          <fpdm>3100183130</fpdm>
          <fphm>19619742</fphm>
          <kprq>20190113 11:00:22</kprq>
          <gmfnsrsbh>9131010758524048XB</gmfnsrsbh>
          <je>23737.07</je>
          <se>3797.93</se>
          <zfbz>N</zfbz>
          <xh>15</xh>
        </mxxx>
        <mxxx>
          <fpdm>3100183130</fpdm>
          <fphm>19619743</fphm>
          <kprq>20190121 18:02:38</kprq>
          <gmfnsrsbh>913101103511274843</gmfnsrsbh>
          <je>60600.00</je>
          <se>9696.00</se>
          <zfbz>N</zfbz>
          <xh>16</xh>
        </mxxx>
        <mxxx>
          <fpdm>3100183130</fpdm>
          <fphm>19619744</fphm>
          <kprq>20190121 18:05:04</kprq>
          <gmfnsrsbh>913101103511274843</gmfnsrsbh>
          <je>99181.03</je>
          <se>15868.97</se>
          <zfbz>N</zfbz>
          <xh>17</xh>
        </mxxx>
        <mxxx>
          <fpdm>3100183130</fpdm>
          <fphm>19619745</fphm>
          <kprq>20190121 18:10:46</kprq>
          <gmfnsrsbh>913101103511274843</gmfnsrsbh>
          <je>95192.25</je>
          <se>15230.75</se>
          <zfbz>N</zfbz>
          <xh>18</xh>
        </mxxx>
        <mxxx>
          <fpdm>3100183130</fpdm>
          <fphm>19619746</fphm>
          <kprq>20190121 18:11:53</kprq>
          <gmfnsrsbh>913101103511274843</gmfnsrsbh>
          <je>86120.69</je>
          <se>13779.31</se>
          <zfbz>N</zfbz>
          <xh>19</xh>
        </mxxx>
        <mxxx>
          <fpdm>3100183130</fpdm>
          <fphm>19619747</fphm>
          <kprq>20190121 18:14:47</kprq>
          <gmfnsrsbh>913101103511274843</gmfnsrsbh>
          <je>51537.93</je>
          <se>8246.07</se>
          <zfbz>Y</zfbz>
          <xh>20</xh>
        </mxxx>
        <mxxx>
          <fpdm>3100183130</fpdm>
          <fphm>19619748</fphm>
          <kprq>20190121 18:15:28</kprq>
          <gmfnsrsbh>913101103511274843</gmfnsrsbh>
          <je>87856.03</je>
          <se>14056.97</se>
          <zfbz>Y</zfbz>
          <xh>21</xh>
        </mxxx>
        <mxxx>
          <fpdm>3100183130</fpdm>
          <fphm>19619749</fphm>
          <kprq>20190121 18:17:46</kprq>
          <gmfnsrsbh>913101103511274843</gmfnsrsbh>
          <je>87856.03</je>
          <se>14056.97</se>
          <zfbz>N</zfbz>
          <xh>22</xh>
        </mxxx>
        <mxxx>
          <fpdm>3100183130</fpdm>
          <fphm>19619750</fphm>
          <kprq>20190121 18:18:55</kprq>
          <gmfnsrsbh>913101103511274843</gmfnsrsbh>
          <je>51537.93</je>
          <se>8246.07</se>
          <zfbz>N</zfbz>
          <xh>23</xh>
        </mxxx>
        <mxxx>
          <fpdm>3100184130</fpdm>
          <fphm>04985051</fphm>
          <kprq>20190219 15:56:21</kprq>
          <gmfnsrsbh>91310115630575335X</gmfnsrsbh>
          <je>21000.00</je>
          <se>3360.00</se>
          <zfbz>N</zfbz>
          <xh>24</xh>
        </mxxx>
        <mxxx>
          <fpdm>3100184130</fpdm>
          <fphm>04985052</fphm>
          <kprq>20190220 12:11:01</kprq>
          <gmfnsrsbh>91320585079926788Y</gmfnsrsbh>
          <je>75387.93</je>
          <se>12062.07</se>
          <zfbz>N</zfbz>
          <xh>25</xh>
        </mxxx>
        <mxxx>
          <fpdm>3100184130</fpdm>
          <fphm>04985053</fphm>
          <kprq>20190220 12:11:17</kprq>
          <gmfnsrsbh>91320585079926788Y</gmfnsrsbh>
          <je>75387.93</je>
          <se>12062.07</se>
          <zfbz>N</zfbz>
          <xh>26</xh>
        </mxxx>
        <mxxx>
          <fpdm>3100184130</fpdm>
          <fphm>04985054</fphm>
          <kprq>20190220 12:11:32</kprq>
          <gmfnsrsbh>91320585079926788Y</gmfnsrsbh>
          <je>75387.93</je>
          <se>12062.07</se>
          <zfbz>N</zfbz>
          <xh>27</xh>
        </mxxx>
        <mxxx>
          <fpdm>3100184130</fpdm>
          <fphm>04985055</fphm>
          <kprq>20190225 17:15:59</kprq>
          <gmfnsrsbh>91320585079926788Y</gmfnsrsbh>
          <je>93606.90</je>
          <se>14977.10</se>
          <zfbz>N</zfbz>
          <xh>28</xh>
        </mxxx>
      </zyfpkjmx>
      <zyfpkjhjxx>
        <zyfpkjhjs>28</zyfpkjhjs>
        <zzszyfphjJe>1988443.66</zzszyfphjJe>
        <zzszyfphjSe>318150.96</zzszyfphjSe>
      </zyfpkjhjxx>
      <ptfpkjmx />
      <ptfpkjhjxx>
        <ptfpkjhjs>0</ptfpkjhjs>
        <ptfpkjhjJe>0</ptfpkjhjJe>
        <ptfpkjhjSe>0</ptfpkjhjSe>
      </ptfpkjhjxx>
    </body>
  </sbbZzsfpkjmx>
</taxML>

 

将对应的

          <fpdm>***</fpdm>代码列
          <fphm>***</fphm>编号列

          <kprq>******</kprq>日期
          <gmfnsrsbh>*****</gmfnsrsbh>客户代码
          <je>*****</je>总金额
          <se>*****</se>税额
          <zfbz>N</zfbz> 状态
分别填入表B对应的列

 

请问这个代码怎么写

 

 

<?

 回到顶部
帅哥哟,离线,有人找我吗?
hongyefor
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:二尾狐 帖子:524 积分:3676 威望:0 精华:0 注册:2012/7/27 10:28:00
  发帖心情 Post By:2019/3/9 15:44:00 [显示全部帖子]

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:fa piao.rar


 回到顶部
帅哥哟,离线,有人找我吗?
hongyefor
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:二尾狐 帖子:524 积分:3676 威望:0 精华:0 注册:2012/7/27 10:28:00
  发帖心情 Post By:2019/3/9 16:30:00 [显示全部帖子]

看不懂图片点击可在新窗口打开查看

 回到顶部
帅哥哟,离线,有人找我吗?
hongyefor
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:二尾狐 帖子:524 积分:3676 威望:0 精华:0 注册:2012/7/27 10:28:00
  发帖心情 Post By:2019/3/9 16:48:00 [显示全部帖子]

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:管理项目121.foxdb


 回到顶部
帅哥哟,离线,有人找我吗?
hongyefor
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:二尾狐 帖子:524 积分:3676 威望:0 精华:0 注册:2012/7/27 10:28:00
  发帖心情 Post By:2019/3/9 21:10:00 [显示全部帖子]

For Each dir As String In FileSys.GetDirectories("I:\fa piao\Jskp")
    For Each f As String In FileSys.GetFiles(dir)
        Dim txt As String = FileSys.ReadAllText(f, Encoding.utf8)
        Dim xmlDoc As New System.XML.XmlDocument
        xmlDoc.Loadxml(txt.Trim)
        Dim ndList  = xmlDoc.GetElementsByTagName("Djh")
        output.show(ndlist(0).InnerText)
        ndList  = xmlDoc.GetElementsByTagName("Spmc")
        output.show(ndlist(0).InnerText)
    Next
Next

为什么没有反应,最好能否帮我在项目里写一下代码


 回到顶部
帅哥哟,离线,有人找我吗?
hongyefor
  6楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:二尾狐 帖子:524 积分:3676 威望:0 精华:0 注册:2012/7/27 10:28:00
  发帖心情 Post By:2019/3/10 11:44:00 [显示全部帖子]

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:taxml_zzsfpkjmx_1_1_20190101_20190331_91310116560195731n_v10.rar


 回到顶部
帅哥哟,离线,有人找我吗?
hongyefor
  7楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:二尾狐 帖子:524 积分:3676 威望:0 精华:0 注册:2012/7/27 10:28:00
  发帖心情 Post By:2019/3/11 12:32:00 [显示全部帖子]

Dim db1 As WinForm.DropDownBox = e.Form.Controls("DropBox1")
Dim db2 As WinForm.DropDownBox = e.Form.Controls("DropBox2")
Dim dzml1 As String = db1.text
Dim dzml2 As String = db2.text
For Each f As String In FileSys.GetFiles(dzml2)
    If f.EndsWith(".xml") Then
        Dim txt As String = FileSys.ReadAllText(f, Encoding.utf8)
        Dim xmlDoc As New System.XML.XmlDocument
        xmlDoc.Loadxml(txt.Trim)
        Dim ndList  = xmlDoc.GetElementsByTagName("mxxx")
        For Each dr As object In ndlist
            Dim ndr As Row = Tables("表b").addnew
            For Each n As System.XML.XmlNode In dr.childNodes
                output.show(n.Name & " = " & n.InnerText)
                If n.name = "fpdm" Then
                    ndr("fa piao代码") = n.innertext
                End If
                If n.name = "fphm" Then
                    ndr("fa piao号码") = n.innertext
                End If
                If n.name = "gmfnsrsbh" Then
                    ndr("纳税人识别号") = n.innertext
                End If
                If n.name = "kprq" Then
                    Dim str = n.innertext
                    ndr("开piao日期") = str.SubString(0,4) + "-" + str.SubString(4,2) + "-" + str.SubString(6,2)
                End If
                If n.name = "je" Then
                    ndr("合计金额")  = n.innertext
                End If
                If n.name = "se" Then
                    ndr("合计税额") = n.innertext
                End If
                If n.name = "zfbz" Then
                    ndr("fa piao状态") = n.innertext
                End If
                ndr("价税合计") = val(ndr("合计税额"))+ val(ndr("合计金额"))
               
            Next
        Next
    End If
Next

这样是可以了,但是如何检查是否重复的数据行呢?使其不加载呢

[此贴子已经被作者于2019/3/11 12:32:52编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
hongyefor
  8楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:二尾狐 帖子:524 积分:3676 威望:0 精华:0 注册:2012/7/27 10:28:00
  发帖心情 Post By:2019/3/11 17:17:00 [显示全部帖子]

.NET Framework 版本:2.0.50727.8800
Foxtable 版本:2018.10.9.1
错误所在事件:窗口,窗口1,Button1,Click
详细错误信息:
没有为 字符串“fa piao代码 = '” 和 类型“XmlElement” 定义运算符“&”。

 

Dim db1 As WinForm.DropDownBox = e.Form.Controls("DropBox1")
Dim db2 As WinForm.DropDownBox = e.Form.Controls("DropBox2")
Dim dzml1 As String = db1.text
Dim dzml2 As String = db2.text
For Each f As String In FileSys.GetFiles(dzml2)
    If f.EndsWith(".xml") Then
        Dim txt As String = FileSys.ReadAllText(f, Encoding.utf8)
        Dim xmlDoc As New System.XML.XmlDocument
        xmlDoc.Loadxml(txt.Trim)
        Dim ndList  = xmlDoc.GetElementsByTagName("mxxx")
        For Each dr As object In ndlist
            Dim ndr As DataRow = DataTables("表b").find("fa piao代码 = '" & dr("fpdm") & "'And fa piao号码 = '" & dr("fphm") & "'")
            If ndr Is Nothing Then ndr = DataTables("表b").addnew
            For Each n As System.XML.XmlNode In dr.childNodes
                output.show(n.Name & " = " & n.InnerText)
                If n.name = "fpdm" Then
                    ndr("fa piao代码") = n.innertext
                End If
                If n.name = "fphm" Then
                    ndr("fa piao号码") = n.innertext
                End If
                If n.name = "gmfnsrsbh" Then
                    ndr("纳税人识别号") = n.innertext
                End If
                If n.name = "kprq" Then
                    Dim str = n.innertext
                    ndr("开piao日期") = str.SubString(0,4) + "-" + str.SubString(4,2) + "-" + str.SubString(6,2)
                End If
                If n.name = "je" Then
                    ndr("合计金额")  = n.innertext
                End If
                If n.name = "se" Then
                    ndr("合计税额") = n.innertext
                End If
                If n.name = "zfbz" Then
                    ndr("fa piao状态") = n.innertext
                End If
                ndr("价税合计") = val(ndr("合计税额"))+ val(ndr("合计金额"))
            Next
        Next
    End If
Next

 

怎么回事?

 


 回到顶部
帅哥哟,离线,有人找我吗?
hongyefor
  9楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:二尾狐 帖子:524 积分:3676 威望:0 精华:0 注册:2012/7/27 10:28:00
  发帖心情 Post By:2019/3/11 20:04:00 [显示全部帖子]

{客户编码}[分隔符]"~~"
// 每行格式 :
// 编码~~名称~~简码~~税号~~地址电话~~银行账号~~邮件地址~~备注~~身份证校验

 

请问这个表达式怎么不起作用?

Dim db3 As WinForm.DropDownBox = e.Form.Controls("DropBox3")
Dim dzml3 As String = db3.text
For Each f As String In FileSys.GetFiles(dzml3)
    If f.EndsWith(".txt") Then
        Dim txt As String = FileSys.ReadAllText(f, Encoding.Default)
        Dim mg As New Merger
        mg.SourcePath = dzml3
        mg.Format = "Delimited,~~"
        Dim Parts() As String = f.Split(".txt")
        Dim fo As String = Parts(0)
        Dim fs() As String = fo.Split("\")
        mg.SourceTableName =  fs(1) '指定要合并的表
        msgbox(fs(1))
        mg.DataTableName = "表c" '指定接收数据的表
        mg.Merge() '开始合并
    End If
Next


 回到顶部
帅哥哟,离线,有人找我吗?
hongyefor
  10楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:二尾狐 帖子:524 积分:3676 威望:0 精华:0 注册:2012/7/27 10:28:00
  发帖心情 Post By:2019/3/11 20:26:00 [显示全部帖子]

Dim dlg As new OpenFileDialog
dlg.Filter = "文本文件|*.txt"
Tables("表C").StopRedraw
If dlg.ShowDialog = DialogResult.OK Then
    Dim strs As String = FileSys.ReadAllText(dlg.FileName)
    strs = strs.Replace(vblf,"")
    Dim rs() As String = strs.Split(vbcr)
    For i As Integer = 3 To rs.Length - 1
        Dim cs() As String = rs(i).Split("~~")
        If cs.Length = 9 Then
            Dim dr As DataRow = DataTables("表C").Addnew()
            dr("名称") = cs(1)
            dr("税号") = cs(2)
            dr("地址电话") = cs(3)
            dr("银行账号") = cs(4)
        End If
    Next
End If
Tables("表C").ResumeRedraw

这个也没反应啊


 回到顶部
总数 30 1 2 3 下一页