For Each r As Row In Tables("AAAAAFT").Rows
Dim cmd As New SQLCommand
cmd.C
If r("unitname1") IsNot Nothing
cmd.CommandText = "U PDATE {AAAAAFX} SET prepprice1 = r("prepprice1")*unitrate,prepprice2=r("prepprice2")*unitrate,prepprice3=r("prepprice3")*unitrate,prepprice4=r("prepprice4")*unitrate,prepprice5=r("prepprice5")*unitrate,prepprice6=r("prepprice6")*unitrate,memberprice1=r("memberprice1")*unitrate,memberprice2=r("memberprice2")*unitrate,memberprice3=r("memberprice3")*unitrate where wareid=r("selfid") And unitrownumber=1"
cmd.ExecuteNonQuery()
End If
If r("unitname2") IsNot Nothing
cmd.CommandText = "U PDATE {AAAAAFX} SET prepprice1 = r("prepprice1")*unitrate,prepprice2=r("prepprice2")*unitrate,prepprice3=r("prepprice3")*unitrate,prepprice4=r("prepprice4")*unitrate,prepprice5=r("prepprice5")*unitrate,prepprice6=r("prepprice6")*unitrate,memberprice1=r("memberprice1")*unitrate,memberprice2=r("memberprice2")*unitrate,memberprice3=r("memberprice3")*unitrate where wareid=r("selfid") And unitrownumber=2"
cmd.ExecuteNonQuery()
End If
Next
cmd.commandtext总是报错不让保存,应该怎么写?
[此贴子已经被作者于2018/7/2 14:44:30编辑过]