?
Solved

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

Posted on 2008-10-04
6
Medium Priority
?
229 Views
Last Modified: 2013-11-26
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
Comment
Question by:salman_sulaiman_2008
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 4

Accepted Solution

by:
petr_hlucin earned 400 total points
ID: 22640326
DateTime is located in System namespace. If you still don't see it in IntelliSense try simply typing it there manually and compiling.
0
 
LVL 6

Assisted Solution

by:DocCan11
DocCan11 earned 800 total points
ID: 22640332
It is found in the system namespace..

vb - dim x as system.datetime
c#  System.DateTime x;
0
 
LVL 55

Assisted Solution

by:Jaime Olivares
Jaime Olivares earned 400 total points
ID: 22640376
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Assisted Solution

by:DocCan11
DocCan11 earned 800 total points
ID: 22640455
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
 
LVL 86

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 400 total points
ID: 22641019
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
 

Author Comment

by:salman_sulaiman_2008
ID: 22643500
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question