#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2005
    Posts
    387
    Rep Power
    21

    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
    Cannot implicitly convert type 'string' to 'System.DateTime'
    can anybody help? thanks
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2005
    Posts
    387
    Rep Power
    21
    sorted i had to use:


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

IMN logo majestic logo threadwatch logo seochat tools logo