本文介绍了我如何更改但发生许多错误的C#中如何更改它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Private Sub AddStocksInUpdating()
If txtItemNo.Text = "" Then
MsgBox("Please select item to add stocks.", MsgBoxStyle.Critical, "Select Item")
Exit Sub
End If
Dim strStocksIn As String
strStocksIn = InputBox("Enter number of items : ", "Stocks In")
txtQuantity.Text = Val(txtQuantity.Text) + Val(strStocksIn)
Try
sqL = "INSERT INTO StocksIn(ItemNo, ItemQuantity, SIDate, CurrentStocks) VALUES('" & txtItemNo.Text & "', '" & strStocksIn & "', '" & Format(Date.Now, "Short Date") & "', " & txtQuantity.Text & ")"
ConnDB()
cmd = New OleDbCommand(sqL, conn)
Dim i As Integer
i = cmd.ExecuteNonQuery()
If i > 0 Then
MsgBox("Stocks added successfully", MsgBoxStyle.Information, "Stocks In")
Updateproduct()
End If
Catch ex As Exception
MsgBox(ex.Message)
Finally
cmd.Dispose()
conn.Close()
End Try
End Sub
推荐答案
这篇关于我如何更改但发生许多错误的C#中如何更改它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!