• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 237
  • Last Modified:

I can't seem to find the DateTime data type??

Greetings Experts!
I am using Microsoft Visual Studio 2005 and I have VS Sp1 installed too, the problem I am facing is that in the code behind page I am trying to create variables of the type DateTime, but the DateTime type doesn't get listed on the data types list that pops up, so I am wondering is there a namespace that I need to import for me to use the DateTime data types.??

thanks in advance.

~salman~
0
salman_sulaiman_2008
Asked:
salman_sulaiman_2008
5 Solutions
 
petr_hlucinCommented:
DateTime is located in System namespace. If you still don't see it in IntelliSense try simply typing it there manually and compiling.
0
 
DocCan11Commented:
It is found in the system namespace..

vb - dim x as system.datetime
c#  System.DateTime x;
0
 
Jaime OlivaresCommented:
woulde be better if you write at the beginning of each source file:

Imports System

So you don't have to type System.... every time you need a date time or other fundamental class
0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
DocCan11Commented:
The system namespace is normally either imports (vb) or using (c#) at the start of any file codefile unless it was accidently deleted... That does not mean though that intellisence always picks up things.. so sometimes you still have to put the full name of the class in including the namespace
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
That drives me nuts too...I have to constantly hit the escape key so I can actually code a DateTime.

Intellisense defaults to the newer DateTimeOffset:
http://msdn.microsoft.com/en-us/library/bb384267.aspx

DateTime: http://msdn.microsoft.com/en-us/library/system.datetime(VS.80).aspx
DateTimeOffset: http://msdn.microsoft.com/en-us/library/system.datetimeoffset.aspx

0
 
salman_sulaiman_2008Author Commented:
Greetings everyone!
thanks for the replies! I really appreciate it!
I actually realised that the DateTime type was already on the list, I just had to click on the "ALL" instead of "Common", it seems that the popup list shows the common data types and not all of them, so when I clicked on view ALL then I found the DateTime type.

Best Wishes,

~Salman~
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now