Dim dt As DataTable = New DataTable()
dt.Columns.Add("DtCostProductRuleGUID", GetType(Guid))
dt.Columns.Add("RecollectGUID", GetType(Guid))
dt.Columns.Add("ProjCode", GetType(String))
dt.Columns.Add("ProductGUID", GetType(Guid))
dt.Columns.Add("CostCode", GetType(String))
dt.Columns.Add("CostShortName", GetType(String))
dt.Columns.Add("ParentCode", GetType(String))
dt.Columns.Add("CostLevel", GetType(Integer))
dt.Columns.Add("IfEndCost", GetType(Integer))
dt.Columns.Add("DtCost", GetType(Decimal))
dt.Columns.Add("IsAttend", GetType(Integer))
Dim row As DataRow
Using scope As ConnectionScope = New ConnectionScope
For Each xmlNode In xmlNodeList
strCostCode = xmlNode.Attributes("CostCode").Value
strCostShortName = xmlNode.Attributes("CostShortName").Value
strParetnCode = xmlNode.Attributes("ParentCode").Value
iCostLevel = CInt(xmlNode.Attributes("CostLevel").Value)
iIfEndCost = CInt(xmlNode.Attributes("IfEndCost").Value)
decDtCost = CDec(xmlNode.Attributes("DtCost").Value)
For i = To iProductCount -
row = dt.NewRow()
row("DtCostProductRuleGUID") = Guid.NewGuid()
row("CostCode") = strCostCode
row("CostLevel") = iCostLevel
row("CostShortName") = strCostShortName
row("DtCost") = decDtCost
row("IfEndCost") = iIfEndCost
row("IsAttend") = xmlNode.Attributes(dtProduct.Rows(i).Item("Product")).Value.ToString()
row("ParentCode") = strParetnCode
row("ProductGUID") = dtProduct.Rows(i).Item("ProductGUID").ToString()
row("ProjCode") = sProjCode
row("RecollectGUID") = sRecollectGUID
dt.Rows.Add(row)
Next
Next
'保存金蝶业态
xmlNode = xmlDOM.SelectSingleNode("/data/jdRow")
For i = To iProductCount -
strSQL = "update cb_JdProductRule set JdProductName='" & xmlNode.Attributes(dtProduct.Rows(i).Item("Product")).Value.ToString() & _
"' where RecollectGUID=@RecollectGUID and ProductGUID='" & dtProduct.Rows(i).Item("ProductGUID").ToString() & "';" sbStr.Append(strSQL)
Next
CPQuery.From(sbStr.ToString(), param).ExecuteNonQuery() Dim bulkCopy As SqlBulkCopy = scope.CreateSqlBulkCopy(SqlBulkCopyOptions.FireTriggers)
bulkCopy.DestinationTableName = "cb_DtCostProductRule"
bulkCopy.WriteToServer(dt)
End Using

最新文章

  1. 获取app安装信息私有api
  2. android json解析详细介绍之gson
  3. LintCode 整数排序
  4. CODEVS1001 舒适的路线 (并查集)
  5. read the python code and predict the results --- from <Learn Python The Hard Way>
  6. Js获取当前日期时间及其它操作(转)
  7. kendo ui template的用法
  8. linux命令学习02-通过tomcat学习ps和netstat
  9. 全排列 ( next_permutation)
  10. LeetCode 243. Shortest Word Distance (最短单词距离)$
  11. python模拟shell执行脚本
  12. Java经典编程题50道之三十
  13. Linux+Shell常用命令总结
  14. C#异常:未将对象引用设置到对象的实例。
  15. Docker学习笔记之搭建 Java Web 项目运行环境
  16. stenciljs 学习八 组件测试
  17. 异步FIFO空满设计延迟问题
  18. ASP.NET MVC3默认提供了11种ActionResult的实现
  19. 图形管线之旅 Part2
  20. 解压zip,解决中文乱码

热门文章

  1. java钩子函数
  2. eclipse调试(debug)弹出错误
  3. Python3小白初体验
  4. 常见的C字符串处理函数的源代码
  5. HDU2665 kth number 线段树做法
  6. JS之字符串和数组
  7. UVA 11642 Fire!
  8. snmpd修改端口
  9. vs平台 error link:2019
  10. 使用DbUtils实现增删改查——ResultSetHandler 接口的实现类