Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional ASP.NET 4.5 : in C# and VB
This is the forum to discuss the Wrox book Professional ASP.NET 4.5 in C# and VB by Jason N. Gaylord, Christian Wenz, Pranav Rastogi, Todd Miranda, Scott Hanselman; ISBN: 978-1-1183-1182-0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET 4.5 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old February 4th, 2016, 12:21 PM
Authorized User
Points: 219, Level: 4
Points: 219, Level: 4 Points: 219, Level: 4 Points: 219, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2015
Posts: 43
Thanks: 1
Thanked 0 Times in 0 Posts
Default Error in Ch 10

I work in Ch10 at (Linq to Object)
I Create class in name movie it has all property
Code:
Imports Microsoft.VisualBasic

Public Class Movie
    Public Property Title() As String
    Public Property Director() As String
    Public Property Genre() As Integer
    Public Property Runtime() As Integer
    Public Property ReleaseDate() As DateTime
End Class
my code
Code:
Imports Microsoft.VisualBasic
Partial Class _Default
    Inherits System.Web.UI.Page

    Public Function GetMovies() As List(Of Movie)
        Dim movies As New List(Of Movie) From {
            New Movie With {.Title = "Shrek", .Director = "Andrew Adamson",
                  .Genre = 0, .ReleaseDate = DateTime.Parse("5/16/2001"), .Runtime = 89},
            New Movie With {.Title = "Fletch", .Director = "Michael Ritchie",
                 .Genre = 0, .ReleaseDate = DateTime.Parse("5/31/1985"), .Runtime = 96},
            New Movie With {.Title = "Casablanca", .Director = "Michael Curtiz",
                  .Genre = 1, .ReleaseDate = DateTime.Parse("1/1/1942"), .Runtime = 102},
            New Movie With {.Title = "Batman", .Director = "Tim Burton",
                  .Genre = 1, .ReleaseDate = DateTime.Parse("6/23/1989"), .Runtime = 126},
            New Movie With {.Title = "Dances with Wolves", .Director = "Kevin Costner",
                 .Genre = 1, .ReleaseDate = DateTime.Parse("11/21/1990"), .Runtime = 180},
            New Movie With {.Title = "Dirty Dancing", .Director = "Emile Ardolino",
                  .Genre = 1, .ReleaseDate = DateTime.Parse("8/21/1987"), .Runtime = 100},
            New Movie With {.Title = "The Parent Trap", .Director = "Nancy Meyers",
                  .Genre = 0, .ReleaseDate = DateTime.Parse("7/29/1998"), .Runtime = 127},
            New Movie With {.Title = "Ransom", .Director = "Ron Howard",
                  .Genre = 1, .ReleaseDate = DateTime.Parse("11/8/1996"), .Runtime = 121},
            New Movie With {.Title = "Ocean’s Eleven", .Director = "Steven Soderbergh",
                  .Genre = 1, .ReleaseDate = DateTime.Parse("12/7/2001"), .Runtime = 116},
            New Movie With {.Title = "Steel Magnolias", .Director = "Herbert Ross",
                  .Genre = 1, .ReleaseDate = DateTime.Parse("11/15/1989"), .Runtime = 117},
            New Movie With {.Title = "Mystic Pizza", .Director = "Donald Petrie",
                  .Genre = 1, .ReleaseDate = DateTime.Parse("10/21/1988"), .Runtime = 104},
            New Movie With {.Title = "Pretty Woman", .Director = "Garry Marshall",
                  .Genre = 1, .ReleaseDate = DateTime.Parse("3/23/1990"), .Runtime = 119},
            New Movie With {.Title = "Interview with the Vampire", .Director = "Neil Jordan",
                  .Genre = 1, .ReleaseDate = DateTime.Parse("11/11/1994"), .Runtime = 123},
            New Movie With {.Title = "Top Gun", .Director = "Tony Scott",
                  .Genre = 2, .ReleaseDate = DateTime.Parse("5/16/1986"), .Runtime = 110},
            New Movie With {.Title = "Mission Impossible", .Director = "Brian De Palma",
                  .Genre = 2, .ReleaseDate = DateTime.Parse("5/22/1996"), .Runtime = 110},
            New Movie With {.Title = "The Godfather", .Director = "Francis Ford Coppola",
                  .Genre = 1, .ReleaseDate = DateTime.Parse("3/24/1972"), .Runtime = 175},
            New Movie With {.Title = "Carlito’s Way", .Director = "Brian De Palma",
                  .Genre = 1, .ReleaseDate = DateTime.Parse("11/10/1993"), .Runtime = 144},
            New Movie With {.Title = "Robin Hood: Prince of Thieves",
                  .Director = "Kevin Reynolds", .Genre = 1,
                  .ReleaseDate = DateTime.Parse("6/14/1991"), .Runtime = 143},
            New Movie With {.Title = "The Haunted", .Director = "Robert Mandel",
                 .Genre = 1, .ReleaseDate = DateTime.Parse("5/6/1991"), .Runtime = 100},
            New Movie With {.Title = "Old School", .Director = "Todd Phillips",
                  .Genre = 0, .ReleaseDate = DateTime.Parse("2/21/2003"), .Runtime = 91},
            New Movie With {.Title = "Anchorman: The Legend of Ron Burgundy",
                 .Director = "Adam McKay", .Genre = 0,
                 .ReleaseDate = DateTime.Parse("7/9/2004"), .Runtime = 94},
            New Movie With {.Title = "Bruce Almighty", .Director = "Tom Shadyac",
                  .Genre = 0, .ReleaseDate = DateTime.Parse("5/23/2003"), .Runtime = 101},
            New Movie With {.Title = "Ace Ventura: Pet Detective",
                  .Director = "Tom Shadyac", .Genre = 0,
                  .ReleaseDate = DateTime.Parse("2/4/1994"), .Runtime = 86},
            New Movie With {.Title = "Goonies", .Director = "Richard Donner",
                  .Genre = 0, .ReleaseDate = DateTime.Parse("6/7/1985"), .Runtime = 114},
            New Movie With {.Title = "Sixteen Candles", .Director = "John Hughes",
                  .Genre = 1, .ReleaseDate = DateTime.Parse("5/4/1984"), .Runtime = 93},
            New Movie With {.Title = "The Breakfast Club", .Director = "John Hughes",
                  .Genre = 1, .ReleaseDate = DateTime.Parse("2/15/1985"), .Runtime = 97},
            New Movie With {.Title = "Pretty in Pink", .Director = "Howard Deutch",
                  .Genre = 1, .ReleaseDate = DateTime.Parse("2/28/1986"), .Runtime = 96},
            New Movie With {.Title = "Weird Science", .Director = "John Hughes",
                  .Genre = 0, .ReleaseDate = DateTime.Parse("8/2/1985"), .Runtime = 94},
            New Movie With {.Title = "Breakfast at Tiffany’s", .Director = "Blake Edwards",
                  .Genre = 1, .ReleaseDate = DateTime.Parse("10/5/1961"), .Runtime = 115},
            New Movie With {.Title = "The Graduate", .Director = "Mike Nichols",
                 .Genre = 1, .ReleaseDate = DateTime.Parse("4/2/1968"), .Runtime = 105},
            New Movie With {.Title = "Dazed and Confused", .Director = "Richard Linklater",
                  .Genre = 0, .ReleaseDate = DateTime.Parse("9/24/1993"), .Runtime = 103},
            New Movie With {.Title = "Arthur", .Director = "Steve Gordon",
                 .Genre = 1, .ReleaseDate = DateTime.Parse("9/25/1981"), .Runtime = 97},
            New Movie With {.Title = "Monty Python and the Holy Grail",
                 .Director = "Terry Gilliam", .Genre = 0,
                 .ReleaseDate = DateTime.Parse("5/10/1975"), .Runtime = 91},
              New Movie With {.Title = "Dirty Harry", .Director = "Don Siegel",
                 .Genre = 2, .ReleaseDate = DateTime.Parse("12/23/1971"), .Runtime = 102}
              }

        Return movies
    End Function

    Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
        Dim Movies = GetMovies()

        Me.GridView1.DataSource = Movies
        Me.GridView1.DataBind()

    End Sub
End Class
I have .aspx page it has one gride view
when I debug this the compiler tell me the error in converting from datetime to string I edit also my local time in my laptop
how to solve this
Reply With Quote
Reply


Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch 10 Example application allken BOOK: Beginning Visual C# 2012 0 August 18th, 2014 12:54 PM
Ch 10 tixrus BOOK: Beginning JavaScript and CSS Development with jQuery 0 April 10th, 2010 02:27 PM
Error with CH. 10 ObjectDataSource Control in C# dramsey BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 7 February 14th, 2007 11:09 PM
Ch. 10 Directory listing superkooi BOOK: Beginning ASP 3.0 1 March 3rd, 2005 07:39 AM



All times are GMT -4. The time now is 01:29 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.