新增10行,并且10行都输入相同内容,请老师指教
r = Tables("机器入库").AddNew(10)
r("采购人") = e.Form.Controls("Co1").Value
r("采购日期") = e.Form.Controls("Co2").Value
r("入库日期") = e.Form.Controls("Co3").Value
r("机器孔数") = e.Form.Controls("Co4").Value
r("机器单价") = e.Form.Controls("Co6").Value
r("充电宝数") = e.Form.Controls("Co7").Value
老师这样对吗
r = Tables("机器入库").AddNew(10)
For Each r As Row In Tables("机器入库").rows
If r.DataRow.RowState = DataRowState.Added Then
r("采购人") = e.Form.Controls("Co1").Value
r("采购日期") = e.Form.Controls("Co2").Value
r("入库日期") = e.Form.Controls("Co3").Value
r("机器孔数") = e.Form.Controls("Co4").Value
r("机器单价") = e.Form.Controls("Co6").Value
r("充电宝数") = e.Form.Controls("Co7").Value
End If
Next
for i as integer = 1 to 10
r = Tables("机器入库").AddNew()
r("采购人") = e.Form.Controls("Co1").Value