Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / July 2007

Tip: Looking for answers? Try searching our database.

'Month' is a type and canot be used as an expression

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Luc - 16 Jul 2007 18:38 GMT
Hi All,

any idea what causes this error??
Month is a function, currently used in applications,......

fyi, I'm using Vista bussines + VS2005 pro
Signature

Best regards
Luc N

Peter Duniho - 16 Jul 2007 19:11 GMT
> any idea what causes this error??
> Month is a function, currently used in applications,......

Maybe if you actually post some code that shows how you are getting the  
error, someone could help.

Either there's a difference in how "Month" is defined in the context in  
which you're getting the error, or you have a syntax error in which you're  
using the identifier "Month".  But it's not possible to be any more  
specific than that without some concrete example of what you're talking  
about.

Pete
Cowboy (Gregory A. Beamer) - 16 Jul 2007 20:01 GMT
You ahve something like this:

int month = DateTime.New.Month();

You should have

int month = DateTime.New.Month;

Signature

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
Co-author: Microsoft Expression Web Bible (upcoming)

************************************************
Think outside the box!
************************************************

> Hi All,
>
> any idea what causes this error??
> Month is a function, currently used in applications,......
>
> fyi, I'm using Vista bussines + VS2005 pro
Luc - 17 Jul 2007 07:08 GMT
Dear,
please find the small code snippet which causes the error,......


Dim x As Integer
x = Month(Now)

thanks for your quick response!

Signature

Best regards
Luc


> You ahve something like this:
>
[quoted text clipped - 10 lines]
> >
> > fyi, I'm using Vista bussines + VS2005 pro
Nathan Baulch - 17 Jul 2007 12:08 GMT
> x = Month(Now)

Should be:
x = DateTime.Now.Month

Nato
Luc - 18 Jul 2007 07:30 GMT
Thanks!!
Signature

Best regards
Luc

> > x = Month(Now)
>
> Should be:
> x = DateTime.Now.Month
>
> Nato
Cowboy (Gregory A. Beamer) - 18 Jul 2007 19:14 GMT
Dim x as Integer = DateTime.Now.Month

Signature

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
Co-author: Microsoft Expression Web Bible (upcoming)

************************************************
Think outside the box!
************************************************

> Dear,
> please find the small code snippet which causes the error,......
[quoted text clipped - 18 lines]
>> >
>> > fyi, I'm using Vista bussines + VS2005 pro

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.