3

问题突然出现,我不知道为什么会出现问题以及如何解决。

编译错误

说明:在编译服务此请求所需的资源期间发生错误。请查看以下特定错误详细信息并适当修改您的源代码。

编译器错误消息: BC30057:'Public Sub New(ItemNo As String,POLineMatch As String,ItemNumberPartCode As String,QuantityInvoiced As String,UnitPriceInvoiced As String,ExtendedPrice As String,ItemTax As String,Notes As String)'的参数太多。

这是代码:

Partial Class Plugins_NonPO_GLCoding
  Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
        If Me.InvoiceItemsDV.Table.Rows.Count > 0 Then
            For i As Integer = 0 To Me.InvoiceItemsDV.Table.Rows.Count - 1
                Dim ItemNo As String = Me.NullCheck(Me.InvoiceItemsDV.Table.Rows(i)("ItemNo"))
                Dim POLineMatch As String = Me.NullCheck(Me.InvoiceItemsDV.Table.Rows(i)("POLineMatch"))
                Dim ItemNumberPartCode As String = Me.NullCheck(Me.InvoiceItemsDV.Table.Rows(i)("ItemNumberPartCode"))
                Dim QuantityInvoiced As String = Me.NullCheck(Me.InvoiceItemsDV.Table.Rows(i)("QuantityInvoiced"))
                Dim UnitPriceInvoiced As String = Me.NullCheck(Me.InvoiceItemsDV.Table.Rows(i)("UnitPriceInvoiced"))
                Dim ExtendedPrice As String = Me.NullCheck(Me.InvoiceItemsDV.Table.Rows(i)("ExtendedPrice"))
                Dim GLAccount As String = Me.NullCheck(Me.InvoiceItemsDV.Table.Rows(i)("GLAccount"))
                Dim ItemTax As String = Me.NullCheck(Me.InvoiceItemsDV.Table.Rows(i)("ItemTax"))
                Dim Notes As String = Me.NullCheck(Me.InvoiceItemsDV.Table.Rows(i)("Notes"))
                Dim ItemTaxCode As String = Me.NullCheck(Me.InvoiceItemsDV.Table.Rows(i)("ItemTaxCode"))
                Dim Department As String = Me.NullCheck(Me.InvoiceItemsDV.Table.Rows(i)("Department"))
                Dim ShipToCode As String = Me.NullCheck(Me.InvoiceItemsDV.Table.Rows(i)("ShipToCode"))
                Me.InvoiceItems.Add(New InvoiceItems(ItemNo, POLineMatch, ItemNumberPartCode, QuantityInvoiced, UnitPriceInvoiced, ExtendedPrice, GLAccount, ItemTax, Notes, ItemTaxCode, Department, ShipToCode))
            Next
        End If
End Sub
End Class

Public Class InvoiceItems
    Private _ItemNo As String
    Private _POLineMatch As String
    Private _ItemNumberPartCode As String
    Private _QuantityInvoiced As String
    Private _UnitPriceInvoiced As String
    Private _ExtendedPrice As String
    Private _GLAccount As String
    Private _ItemTax As String
    Private _Notes As String
    Private _ItemTaxCode As String
    Private _Department As String
    Private _ShipToCode As String
    Public Sub New(ByVal ItemNo As String, ByVal POLineMatch As String, ByVal ItemNumberPartCode As String, ByVal QuantityInvoiced As String, ByVal UnitPriceInvoiced As String, ByVal ExtendedPrice As String, ByVal GLAccount As String, ByVal ItemTax As String, ByVal Notes As String, ByVal ItemTaxCode As String, ByVal Department As String, ByVal ShipToCode As String)
        Me._ItemNo = ItemNo
        Me._POLineMatch = POLineMatch
        Me._ItemNumberPartCode = ItemNumberPartCode
        Me._QuantityInvoiced = QuantityInvoiced
        Me._UnitPriceInvoiced = UnitPriceInvoiced
        Me._ExtendedPrice = ExtendedPrice
        Me._GLAccount = GLAccount
        Me._ItemTax = ItemTax
        Me._Notes = Notes
        Me._ItemTaxCode = ItemTaxCode
        Me._Department = Department
        Me._ShipToCode = ShipToCode
    End Sub
    Public Property ItemNo() As String
        Get
            Return Me._ItemNo
        End Get
        Set(ByVal value As String)
            Me._ItemNo = value
        End Set
    End Property
' There are too many get sets so i deleted them out and left one for example
End Class

一切正常,甚至在我的重复机器上一切正常,它应该如何工作,弹出这个错误的原因是什么?

4

1 回答 1

2

看来您的构造函数不一样:

From error: Public Sub New(ItemNo As String, POLineMatch As String, ItemNumberPartCode As String, QuantityInvoiced As String, UnitPriceInvoiced As String, ExtendedPrice As String, ItemTax As String, Notes As String)
From code:  Public Sub New(ByVal ItemNo As String, ByVal POLineMatch As String, ByVal ItemNumberPartCode As String, ByVal QuantityInvoiced As String, ByVal UnitPriceInvoiced As String, ByVal ExtendedPrice As String, ByVal GLAccount As String, ByVal ItemTax As String, ByVal Notes As String
                           , **ByVal ItemTaxCode As String, ByVal Department As String, ByVal ShipToCode As String**)

我猜你必须在重新编译之前清理你的解决方案。如果它不起作用,请找到您在机器上编译的所有 dll 并将它们从您的机器中删除。可能存在未正确清理的 dll。或者您显示的代码可能不是您的错误的原因。

于 2013-01-18T09:54:13.333 回答