Foxtable(狐表)用户栏目专家坐堂 → 数据更新


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

主题:数据更新

美女呀,离线,留言给我吧!
qianqian1530
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:746 积分:5567 威望:0 精华:0 注册:2013/12/4 8:56:00
数据更新  发帖心情 Post By:2015/4/24 9:32:00 [显示全部帖子]

为真么 总是说找不到  Cols1() 组里的表呢?

DataSource 数据库里面有啊, (不在胡表里.)

'''
'数据更新
Dim cmd As New SQLCommand
Dim dt As DataTable
cmd.C
Dim Cols1() As String = {"administrator_st_Data","administrator_st_Amazon","administrator_st_Yahoo","administrator_st_Rakuten"}
Dim Cols2() As String = {"st_Data","st_Amazon","st_Yahoo","st_Rakuten"}
Dim Cols3() As String = {"商品型番","sku","code","商品番号"}
For i As Integer = 0 To Cols1.Length -1
    cmd.CommandText = "SE LECT * From {" & Cols1(i) & "}"
    dt = cmd.ExecuteReader()
e.Form.Controls("TextBox33").text & =VbCrLf &  Date.now & VbCrLf  & " ∟导入" & Cols1(i)
    For Each dr1 As DataRow In dt.DataRows
        Dim dswr As DataRow = DataTables(Cols2(i)).Find("[" & Cols3(i) & "] = '" & dr1(Cols3(i)) & "'")
        If dswr IsNot Nothing Then
        Else
            Dim dr2 As DataRow = DataTables(Cols2(i)).AddNew()
            For Each dc As DataCol In DataTables(Cols1(i)).DataCols
                dr2(dc.Name) = dr1(dc.name)
            Next
        End If
    Next
Next
Application.DoEvents()

 回到顶部
美女呀,离线,留言给我吧!
qianqian1530
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:746 积分:5567 威望:0 精华:0 注册:2013/12/4 8:56:00
  发帖心情 Post By:2015/4/24 10:04:00 [显示全部帖子]

我设置了,   网页里不现实 ``  

 回到顶部
美女呀,离线,留言给我吧!
qianqian1530
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:746 积分:5567 威望:0 精华:0 注册:2013/12/4 8:56:00
  发帖心情 Post By:2015/4/24 10:05:00 [显示全部帖子]

'''
'数据更新
Dim cmd As New SQLCommand
Dim dt As DataTable
cmd.Connectio nName = "DataSource"
Dim Cols1() As String = {"administrator_st_Data","administrator_st_Amazon","administrator_st_Yahoo","administrator_st_Rakuten"}
Dim Cols2() As String = {"st_Data","st_Amazon","st_Yahoo","st_Rakuten"}
Dim Cols3() As String = {"商品型番","sku","code","商品番号"}
For i As Integer = 0 To Cols1.Length -1
    cmd.CommandText = "SE LECT * From {" & Cols1(i) & "}"
    dt = cmd.ExecuteReader()
e.Form.Controls("TextBox33").text & =VbCrLf &  Date.now & VbCrLf  & " ∟导入" & Cols1(i)
    For Each dr1 As DataRow In dt.DataRows
        Dim dswr As DataRow = DataTables(Cols2(i)).Find("[" & Cols3(i) & "] = '" & dr1(Cols3(i)) & "'")
        If dswr IsNot Nothing Then
        Else
            Dim dr2 As DataRow = DataTables(Cols2(i)).AddNew()
            For Each dc As DataCol In DataTables(Cols1(i)).DataCols
                dr2(dc.Name) = dr1(dc.name)
            Next
        End If
    Next
Next
Application.DoEvents()

 回到顶部
美女呀,离线,留言给我吧!
qianqian1530
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:746 积分:5567 威望:0 精华:0 注册:2013/12/4 8:56:00
  发帖心情 Post By:2015/4/24 10:12:00 [显示全部帖子]

  ```

图片点击可在新窗口打开查看此主题相关图片如下:360桌面截图20150424110957.jpg
图片点击可在新窗口打开查看


 回到顶部
美女呀,离线,留言给我吧!
qianqian1530
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:746 积分:5567 威望:0 精华:0 注册:2013/12/4 8:56:00
  发帖心情 Post By:2015/4/24 10:17:00 [显示全部帖子]

Bin ,
是  

For Each dc As DataCol In DataTables(Cols1(i)).DataCols
                dr2(dc.Name) = dr1(dc.name)
 Next
这句话里的   DataTables(Cols1(i)).DataCols  这个代码有问题, 要怎么修改啊

 回到顶部
美女呀,离线,留言给我吧!
qianqian1530
  6楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:746 积分:5567 威望:0 精华:0 注册:2013/12/4 8:56:00
  发帖心情 Post By:2015/4/24 10:27:00 [显示全部帖子]

ok 了!  嘿嘿~

 回到顶部