改一下代码
If DataTables("供应商样品管理主表").HasChanges Or DataTables("供应商样品管理从表").HasChanges Then
Dim cmd As New SQLCommand
Dim nm As String =e.Form.Controls("e单据编号").Value
cmd.C
cmd.CommandText="Select count(*) From {供应商样品管理主表} Where 单据编号='" & nm & "'"
If cmd.ExecuteScalar > 0 Then
MessageBox.Show("555!","提示:",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
End If