With Tables("销售主表")
If .Current IsNot Nothing Then
.Current.Save()
End If
End With
Dim dr As DataRow = e.DataRow
Dim pf As String
If dr.RowState <> DataRowState.Added Then
Return
ElseIf dr.IsNull("制单日期") Then
e.Cancel = True
MessageBox.Show("必须输入日期!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
Else
pf = "SHDH" & "" & Format(dr("制单日期"),"yyyyMM")
End If
Dim cmd1 As New SQLCommand
Dim cmd2 As New SQLCommand
Dim Key As Integer
cmd1.C '设置数据源名称
cmd2.C
后面是SQL语句,论坛贴不上,就省略,
报错这个异常,要怎么改,

此主题相关图片如下:保存编号报错.jpg
