我的vb页面中有一些代码,我遇到了问题。
这是代码
'Vnesi proizvod
Try
'Kreiraj adapter
Dim TA As New POSDSTableAdapters.ItemsTableAdapter
'Vnesi proizvod
TA.Insert(TextBox1.Text, TextBox2.Text, SellPrice, BuyPrice)
Me.DialogResult = Windows.Forms.DialogResult.OK
Catch ex As Exception
End Try
End Sub
我得到了这个错误:
错误1未为参数'Tax'指定'Public Overridable Overloads Function Insert(Barcode As Integer ?, ItemName As String,BuyPrice As Decimal?,SellPrice As Decimal?,Tax As Integer?)As Integer'。 C:\ Users \ User \ Desktop \ prodazba \ POS \ POS \ GUI \ AddItem.vb 71 13 POS
答案 0 :(得分:0)
错误消息表明这些是函数的参数
(Barcode As Integer?, ItemName As String, BuyPrice As Decimal?, SellPrice As Decimal?, Tax As Integer?)
但是你传递了这些论点
TA.Insert(TextBox1.Text, TextBox2.Text, SellPrice, BuyPrice)
您需要以相同的顺序传递相同的参数
TA.Insert(barcode, itemname, buyprice, sellprice, tax)
此外,条形码是一个整数。如果TextBox1是条形码,那么您需要将其转换为整数。如果您没有税,我认为您可以通过0。
TA.Insert(Int32.Parse(TextBox1.Text), TextBox2.Text, buyprice, sellprice, 0)