---------------------------
错误
---------------------------
编译错误:需要对程序集“System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”(包含基类“System.ComponentModel.Design.DesignerActionList”)的引用。请在项目中添加一个。
错误代码:dr= DataTables("计划发货明细").Find("销售订单号 = '" & bh & "' and 客户编号='" & kh & "' and 产品编号='" & cp & "' and 计划单号='" & .current("计划单号") & "'")
---------------------------
确定
---------------------------
With Tables("发货计划单")
If .current IsNot Nothing Then
Dim dlg As New OpenFileDialog '定义一个新的OpenFileDialog
dlg.Filter= "Excel文件|*.xls|Excel2007文件|*.xlsx" '设置筛选器
If dlg.ShowDialog = DialogResult.Ok Then '如果用户单击了确定按钮
''MessageBox.Show("你选择的是:" & dlg.FileName,"提示") '提示用户选择的文件
Dim Book As New XLS.Book(dlg.FileName)
Dim Sheet As XLS.Sheet = Book.Sheets(0)
Tables("计划发货明细").StopRedraw()
'注意以下数组中列名称的顺序,必须和Excel表中的列顺序一致
Dim nms() As String = {"销售订单号","客户编号","产品编号","计划发货数量","计划发货日期"}
'注意下面的循环变量从1开始,而不是从0开始,因为Excel表的第一行是标题
For n As Integer = 1 To Sheet.Rows.Count -1
Dim ddh As String = sheet(n,0).Text
Dim kh As String = sheet(n,1).Text
Dim cp As String = sheet(n,2).Text
Dim dr As DataRow
dr= DataTables("计划发货明细").Find("销售订单号 = '" & bh & "' and 客户编号='" & kh & "' and 产品编号='" & cp & "' and 计划单号='" & .current("计划单号") & "'")
If dr IsNot Nothing Then
dr("计划发货数量")=sheet(n,3).Text
dr("计划发货日期")=sheet(n,4).Text
End If
Next
Tables("计划发货明细").ResumeRedraw()
End If
End If
End With