473,387 Members | 1,742 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

how to us Microsoft.VisualBasic.DateAndTime.MonthName

how can i use the DateAndTime module in my csharp code

i included a using statement:

using Microsoft.VisualBasic;

and then called the function:

DateAndTime.MonthName(1);

but i keep getting a "The name 'DateAndTime' does not exist in the current
context" error

thank you for your help

Nov 17 '05 #1
4 3373
Abraham Andres Luna wrote:
i included a using statement:

using Microsoft.VisualBasic;


A using statement by itself, is not enough. You need to set a
reference to the Visual Basic assembly (.dll) as well.

If you have a DateTime variable, you can get the full month name from
that as per this example:

Dim dt As DateTime = DateTime.Now
MsgBox(dt.ToString("MMMM"))

Nov 17 '05 #2
Have a look at the this google thread:

http://groups.google.com/group/micro...29641cf1030d61

HTH

Ollie Riches

"Abraham Andres Luna" <ab*@rdk.com> wrote in message
news:up**************@TK2MSFTNGP14.phx.gbl...
how can i use the DateAndTime module in my csharp code

i included a using statement:

using Microsoft.VisualBasic;

and then called the function:

DateAndTime.MonthName(1);

but i keep getting a "The name 'DateAndTime' does not exist in the current
context" error

thank you for your help

Nov 17 '05 #3
Hi,

You do not need to use VB for this, DateTime.ToString() has an overloaded
version that accept a DateTimeFormatInfo that do just that.

For your case you could use MMM for the abreviated name or MMMM for the
fullname

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Abraham Andres Luna" <ab*@rdk.com> wrote in message
news:up**************@TK2MSFTNGP14.phx.gbl...
how can i use the DateAndTime module in my csharp code

i included a using statement:

using Microsoft.VisualBasic;

and then called the function:

DateAndTime.MonthName(1);

but i keep getting a "The name 'DateAndTime' does not exist in the current
context" error

thank you for your help

Nov 17 '05 #4
thank you

"Ollie Riches" <ol**********@phoneanalyser.net> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Have a look at the this google thread:

http://groups.google.com/group/micro...29641cf1030d61

HTH

Ollie Riches

"Abraham Andres Luna" <ab*@rdk.com> wrote in message
news:up**************@TK2MSFTNGP14.phx.gbl...
how can i use the DateAndTime module in my csharp code

i included a using statement:

using Microsoft.VisualBasic;

and then called the function:

DateAndTime.MonthName(1);

but i keep getting a "The name 'DateAndTime' does not exist in the
current context" error

thank you for your help


Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Wharfrat | last post by:
Hey all, I have a query that pulls data based on the month. I'm using MONTHNAME(CURDATE()) to get the current month. I need to get the previous month. Is there a way to do this using MONTHNAME?...
2
by: darrel | last post by:
I've built a control. At the top of my control, I have this: Imports Microsoft.VisualBasic Then, later, I call a function like this: DateTime.Now.Year.ToString() This works fine on my...
15
by: Phill. W | last post by:
Is anyone writing VB.Net (2003) code /without/ referencing the Microsoft.VisualBasic namespace(?), regardless of whether its Import'ed or not? The Powers That Be here are trying to introduce a...
14
by: frostalicious | last post by:
Used VB.NET (on my client PC) to convert VB6 executable to .NET executable. Placed the .exe file on a network drive on my server. From client, ran .NET Wizards "Trust an Assembly" to make the...
2
by: Steve | last post by:
Having only recently migrated across from VB6 to VB.NET I'm still unsure whether or not I should be making (heavy) use of the Microsoft.VisualBasic namespace in new applications. I've read a lot...
9
by: Alexander Baranovsky | last post by:
Hello friends, How I can determine full path of Microsoft.Basic.dll? Thanks, Alexander
8
by: Dave | last post by:
I'm trying to import Microsoft.VisualBasic to use the IsNumeric function in my C# code but all I see is: Microsoft.VisualBasic.VBCodeProvider while using Intellisense... From samples shouldn't...
3
by: Metplant | last post by:
I have almost no experience in ACCESS so am trying to get the system functioning with minimal operator input. Currently I have managed to modify a database generated by a SCADA system using a...
2
by: veaux | last post by:
I have single integers representing a month (i.e. 2) and need to convert this to (March 1, 2007). So "2" represents really the end of the previous month. I'm using MonthName and adding 1 in my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.