Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi frens


I need to convert the following code(vb) to c# ....how can i do it

C#
DateAndTime.WeekdayName(DateAndTime.Weekday(iDate,Constants.vbsunday),false,constants.vbsunday + "" + DateAndTime.MonthName(DateAndTime,Month(idate))+ "" ;



Thanks in Advance
Darshan
Posted
Updated 21-Dec-12 2:30am
v2
Comments
[no name] 21-Dec-12 8:07am    
What you are trying to achieve ??
Zoltán Zörgő 21-Dec-12 8:31am    
It looks to me as simple formatting... What is the input, and what output you want?

With the exception of one missing bracket it is already C# - as shown by the terminating semicolon.

You have a missing close bracket, which I assume should be after the vbsunday.

To translate from VB to C# try this: http://www.developerfusion.com/tools/convert/vb-to-csharp/[^]
 
Share this answer
 
Comments
darshan559 21-Dec-12 9:01am    
Thanks for the reply .....Ya i tried to convert to c# using a tool ....Actually It ws in VB ....DateandTIme.WeekDayName() i guess is a inbuilt VB Function Which is not available in c#...So i need C# equivalent of DateandTIme.WeekDayName(); function
OriginalGriff 21-Dec-12 9:06am    
Try:
DateTime now = DateTime.Now;
Console.WriteLine(now.DayOfWeek.ToString());
 
Share this answer
 
Hi,

Some online convert tools:
http://www.dotnetspider.com/convert/Vb-To-Csharp.aspx[^]
http://codeconverter.sharpdevelop.net/SnippetConverter.aspx[^]
And to get the DateAndTime class, you need to add a reference to Microsoft.VisualBasic.dll.
 
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