Method params match signature, but still getting error
Posted
by
Jason
on Stack Overflow
See other posts from Stack Overflow
or by Jason
Published on 2010-12-22T20:38:50Z
Indexed on
2010/12/22
20:54 UTC
Read the original article
Hit count: 203
I am in the midst of converting a VB library to C#. One of my methods has the following signature in VB:
Private Shared Sub FillOrder(ByVal row As DataRowView, ByRef o As Order)
In C# I converted it to:
private static void FillOrder(DataRowView row, ref Order o)
From my constructor inside my Order
class, I am calling the FillOrder()
method like so:
DataView dv = //[get the data]
if (dv.Count > 0)
{
FillOrder(dv[0], this);
}
In VB, this works:
Dim dv As DataView = '[get data]'
If dv.Count > 0 Then
FillOrder(dv.Item(0), Me)
End If
However, in VS10 in the C# file I am getting a red squiggle under this call with the following error:
The best overloaded method match for [the method] has some invalid arguments
This was working code in VB. What am I doing wrong?
© Stack Overflow or respective owner