.Net Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - More.Net Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 20th, 2012, 07:22 AM
delboy31 delboy31 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 387 delboy31 User rank is Sergeant (500 - 2000 Reputation Level)delboy31 User rank is Sergeant (500 - 2000 Reputation Level)delboy31 User rank is Sergeant (500 - 2000 Reputation Level)delboy31 User rank is Sergeant (500 - 2000 Reputation Level)delboy31 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Days 13 h 8 m 24 sec
Reputation Power: 20
C# and VB difference

Hi all, using vb.net the following works:

Code:
Dim datecreated As Date

datecreated = elemList(i).Attributes("ows_Created").Value


but when using C#:
Code:

 DateTime datecreated;

datecreated = elemList[i].Attributes["ows_Created"].Value;


I get an error
Quote:
Cannot implicitly convert type 'string' to 'System.DateTime'


can anybody help? thanks

Reply With Quote
  #2  
Old November 20th, 2012, 07:40 AM
delboy31 delboy31 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 387 delboy31 User rank is Sergeant (500 - 2000 Reputation Level)delboy31 User rank is Sergeant (500 - 2000 Reputation Level)delboy31 User rank is Sergeant (500 - 2000 Reputation Level)delboy31 User rank is Sergeant (500 - 2000 Reputation Level)delboy31 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Days 13 h 8 m 24 sec
Reputation Power: 20
sorted i had to use:


datecreated = Convert.ToDateTime(elemList[i].Attributes["ows_Created"].Value);

Reply With Quote
  #3  
Old December 12th, 2012, 06:05 AM
jaysh4922 jaysh4922 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 31 jaysh4922 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 5 m 22 sec
Reputation Power: 1
You can go through this link for details (thecodekey.com/Diff/C_Sharp_Vs_VB_net.aspx)

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - More.Net Development > C# and VB difference

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap