Dim qdt As new QueryBuilder
qdt.TableName = "临时"
qdt.C
qdt.SelectString = "select * fr om {扫描配货明细}"
qdt.Build
DataTables("临时").DataCols("生产结束扫描完成时间").SetDateTimeFormat(DateTimeFormatEnum.DateLongTime)
DataTables("临时").DataCols("生成收货单时间").SetDateTimeFormat(DateTimeFormatEnum.DateLongTime)
Tables("临时").Sort = "生产结束扫描完成时间"
Dim dlg As New SaveFileDialog
dlg.Filter= "Excel文件|*.xls"
dlg.FileName = "全部序列号明细"
If dlg.ShowDialog = DialogResult.Ok Then
Tables("临时").SaveExcel(dlg.FileName, "SN")
DataTables.Unload("临时")
MessageBox.show("保存路径:" & dlg.filename,"保存成功!",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
弹出的msgbox后,点击确定,当前的form自动关掉了。