Select Case e.DataCol.name
Case "编号", "数量", "日期"
Dim bh As String
Dim sl As Double
Dim rx As Date
If e.DataCol.Name = "编号" Then
bh = e.NewValue
sl = e.DataRow("数量")
rx = e.DataRow("日期")
Else
sl = e.NewValue
rx = e.DataRow("日期")
bh = e.DataRow("编号")
End If
If bh > "" AndAlso sl > "" AndAlso rx > ""Then
Dim dr As DataRow = e.DataRow
If e.DataTable.Find("编号 = '" & bh & "' And 数量 = '" & sl & "'And 日期 = '" & rx & "'") IsNot Nothing Then
MessageBox.Show("已经存在相同型号和规格的行!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
e.Cancel = True
End If
End If
End Select
上面代码报错,提示字符转换问题,在哪里转换,如何转换?谢谢