大师:请问下面的代码错在哪里?
Try
Connections(hbconn).BeginTransaction() '开始事务
Dim cmd As New SQLCommand
cmd.ConnectionName = hbconn
For Each zh As String In mczh
lmzf = zh.Split("--")(0)
glwljh1 = glwltjbdt.Select("gljytjb8 = '" & hbztzz & "' and gljytjb9 = '" & hbztnd & "'and gljytjb10 = '" & hbztyf & "'" & " and gljytjb1 = '" & lmzf & "'")
For Each tr As DataRow In glwljh1
If tr("gljytjb4") Like "商品交易-销售" Then
cmd.CommandText = "Insert Into {dtjymxb} (dtjymxb1,dtjymxb2,dtjymxb3,dtjymxb5,dtjymxb6) Values('" & zh & "','" & tr("gljytjb4") & "','" & tr("gljytjb6") & "','" & tr("gljytjb14") & "','" & tr("gljytjb15") & "')"
ElseIf tr("gljytjb4") Like "固定资产交易-出售" Then
cmd.CommandText = "Insert Into {dtjymxb} (dtjymxb1,dtjymxb2,dtjymxb44,dtjymxb46,dtjymxb47,dtjymxb50) Values('" & zh & "','" & tr("gljytjb4") & "','" & tr("gljytjb77") & "','" & tr("gljytjb35") & "','" & tr("gljytjb36") & tr("gljytjb37") & "')"
ElseIf tr("gljytjb4") Like "无形资产交易-出售" Then
cmd.CommandText = "Insert Into {dtjymxb} (dtjymxb1,dtjymxb2,dtjymxb99,dtjymxb101,dtjymxb102,dtjymxb105) Values('" & zh & "','" & tr("gljytjb4") & "','" & tr("gljytjb87") & "','" & tr("gljytjb57") & "','" & tr("gljytjb58") & tr("gljytjb59") & "')"
End If
cmd.ExecuteNonQuery()
Next
Next
Connections(hbconn).Commit '提交事务,所有操作生效
Catch ex As Exception '如果出错
Connections(hbconn).Rollback() '回滚事务,撤销所有操作
End Try