Click here to Skip to main content
15,885,309 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
my code is :

VB
Sub fullmydate()

        Dim mydate As String = String.Empty
        Dim calender As PersianCalendar
        mydate = calender.GetYear(DateTime.Now).ToString() + @"/" + calender.GetMonth(DateTime.Now).ToString() + @"/" + calender.GetDayOfMonth(DateTime.Now).ToString()

        Return mydate
 End Sub



i had written this code in c# and it works well but when i convert it to vb, it shows error for ( "@" and "Return mydate")
what is wrong with them?????

thanks alot
Posted
Updated 16-Aug-11 16:04pm
v2

This is not VB, this is VB.NET, completely different thing. Please change the tag of your question, don't waste expert's time.

Now, what you mean by "convert to vb"? You need to translate the code, not just copy pieces without thinking. For VB.NET, string concatenation operator is '&', not '+', and '@' (a prefix for verbose string literal required in C#) is not applicable to VB.NET, just remove it.

Do it; and it will compile.

—SA
 
Share this answer
 
In addition to the previous solution, you can use this[^] as a reference when you are translating C# to VB.Net.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900