Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Donate Today!

Do you enjoy these
technical forums?
Donate Today! Click Here

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

sqlsamurai (Programmer)
16 Aug 06 15:54
I want to test an object for type and I'm not sure how.

Here is the object:
     My.Settings("StartDate")

I want to test the value to see what type it is.

Like this

If My.Settings("StartDate").GetType = DateTime then
...
End IF

Could somebody help?
TipGiver (Programmer)
16 Aug 06 17:16
Hi.

When you add a setting, you specify its type.... so you know what it is. Anyway ..

If My.Settings("StartDate").GetType.ToString() = DateTime then


Regards
Helpful Member!  chrissie1 (Programmer)
17 Aug 06 2:27
or

My.Settings("StartDate").GetType is DateTime

Christiaan Baes
Belgium

"My new site" - Me

Helpful Member!  SavantMan (Programmer)
17 Aug 06 3:11
or use TypeOf

CODE

TypeOf My.Settings("StartDate") is DateTime
sqlsamurai (Programmer)
17 Aug 06 8:21
Thanks for all the suggestions guys. winky smile In the end this is what I used.

If My.Settings("StartDate").GetType.Equals(GetType(Date)) Then
End If
TipGiver (Programmer)
17 Aug 06 8:30
Hi, just to undo my mistake..

If My.Settings("StartDate").GetType.ToString().ToLower() = "system. bla bla" then

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close