求教: 在开发中遇到如下问题: 用代码向后台写入单据信息,再读出时,大部份时间能正常执行,偶尔会出错,我加入了红色代码部又正常了。是网络延时(数据还没更新到客户端的datatable表中造成的吗?) 有无更合理的办法?
'提取窗体传递信息
Select Case Current_frmOpenArgs
Case "xsddlist_add"
Dim Current_newdjbh As String = newnumber("销售定单")
Dim cmd As new SQLCommand
cmd.ConnectionName = Current_SQLCname1
cmd.CommandText = "Insert Into tbl_xs_xsdd (djbh,ywgs,djrq,zdry) Values(?,?,?,?)"
cmd.Parameters.Add("@djbh",Current_newdjbh)
cmd.Parameters.Add("@ywgs",1)
cmd.Parameters.Add("@djrq",Date.Today)
cmd.Parameters.Add("@zdry",Current_UserID)
cmd.ExecuteScalar()
cur_products.Insert(0,Current_newdjbh )
cur_djzz = cur_Products.Indexof(Current_newdjbh)
Dim I As Integer
For I = 1 To 5
Next I
tb.DataTable.LoadFilter = "djbh = N'" & Current_newdjbh & "'"
tb.DataTable.Load
tb.AllowEdit = True
tb1.DataTable.LoadFilter = "djbh = N'" & Current_newdjbh & "'"
tb1.DataTable.Load
tb1.AllowEdit = True