473,660 Members | 2,437 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to us Microsoft.Visua lBasic.DateAndT ime.MonthName

how can i use the DateAndTime module in my csharp code

i included a using statement:

using Microsoft.Visua lBasic;

and then called the function:

DateAndTime.Mon thName(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 3382
Abraham Andres Luna wrote:
i included a using statement:

using Microsoft.Visua lBasic;


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.ToStr ing("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******** ******@TK2MSFTN GP14.phx.gbl...
how can i use the DateAndTime module in my csharp code

i included a using statement:

using Microsoft.Visua lBasic;

and then called the function:

DateAndTime.Mon thName(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.ToStri ng() has an overloaded
version that accept a DateTimeFormatI nfo 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******** ******@TK2MSFTN GP14.phx.gbl...
how can i use the DateAndTime module in my csharp code

i included a using statement:

using Microsoft.Visua lBasic;

and then called the function:

DateAndTime.Mon thName(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**********@p honeanalyser.ne t> wrote in message
news:%2******** ********@TK2MSF TNGP11.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******** ******@TK2MSFTN GP14.phx.gbl...
how can i use the DateAndTime module in my csharp code

i included a using statement:

using Microsoft.Visua lBasic;

and then called the function:

DateAndTime.Mon thName(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
3516
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? thanks in advance
2
4236
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 machine. My coworker takes the exact same file, compiles it, and gets errors until he explicitly writes out the function as:
15
4024
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 "standard" that we should be writing our "VB" programs /without/ using this namespace at all and relying instead solely on CLR functionality. Comments and Opinions please...
14
2315
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 .exe (on the network drive, on the server) "Full Trust." From the client, double-click on the ..exe (on the network drive, on the server) and it runs fine. So far, so good, but... On the server, where I've installed not VB.NET but .NET
2
2100
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 of posts in the (VB).Net newsgroups and seen just about all of the For and Against arguments i.e. not using it = not coding in VB.NET, not using it = good OO. I'm also aware of the difference between this namespace and the compatibility namespace....
9
6819
by: Alexander Baranovsky | last post by:
Hello friends, How I can determine full path of Microsoft.Basic.dll? Thanks, Alexander
8
3227
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 I see Microsoft.VisualBasic.Information.IsNumeric? Thanks
3
2021
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 query which generates a PIVOT table, grouped by DateAndTime, for all the desired data for Reporting purposes. I have not been able to set the DateAndTime range of that data; so then a set group of data can be sent as a file to an archive location...
2
2829
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 query and this is working fine. (Ex/ MonthName(+1)&" 1, 2007). Issue is I'm then using a MS Word Mail Merge to look at this query and pull in the date. Word doesn't seem to like the MonthName function so won't even display the query when I...
0
8341
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8754
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4177
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4343
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1984
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1740
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.