Function to amend databound output

I've been writing VB.net for yonks, but have been thrown a c# project to work on. Pretty much sussed it apart from one little problem.
I have a Linq populated dataview with a label in it. The db returns a bit field to populate. I want to convert the "True" / "False" returned by the db to "Y" / "N".
How hard can it be?? Well I've been pouring over it for ages......

Here is the label:
<asp:Label ID="Label1" runat="server" Text='<%# DoYN(Eval("Paid")) %>'></asp:Label>

and my DoYN function

public string DoYN(string Paid)
        {
            if ((Paid.Trim() == "True"))
            {
                return "Y";
            }
            else if ((Paid.Trim() == "False"))
            {
                return "N";
            }
            else
            {
                return "";
            }
        }

But I get the following error:
The best overloaded method match for DoYNstring) has some invalid arguments.

Anyone shed any light on this please?
ilikemycarAsked:
Who is Participating?
 
dstanley9Connect With a Mentor Commented:
try

<asp:Label ID="Label1" runat="server" Text='<%# DoYN(Eval("Paid").ToString()) %>'></asp:Label>
0
 
ilikemycarAuthor Commented:
Bingo!
Thanks for that
0
All Courses

From novice to tech pro — start learning today.