Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 8th, 2009, 06:10 PM
Authorized User
 
Join Date: Oct 2009
Posts: 22
Thanks: 7
Thanked 0 Times in 0 Posts
Default Complie Issue

I transferred my planetwrox site from a laptop to my desktop and now I get a compile-time error in my planetwrox.designer.vb file. I don't know why this happened since I don't alter the code there. There are several errors but it looks like the root of the problem is with the Picture class. I'll post the code that generates the errors. Also what is the cryptic code at the very bottom?

Code:
<Table(Name:="dbo.Picture")>  _
Partial Public Class Picture
	Implements System.ComponentModel.INotifyPropertyChanging, System.ComponentModel.INotifyPropertyChanged
	
	Private Shared emptyChangingEventArgs As PropertyChangingEventArgs = New PropertyChangingEventArgs(String.Empty)
	
	Private _Id As Integer
	
	Private _Description As String
	
	Private _Tooltip As String
	
	Private _ImageUrl As String
	
	Private _PhotoAlbumId As Integer
	
	Private _PhotoAlbum As EntityRef(Of PhotoAlbum)
	
    #Region "Extensibility Method Definitions"
    Partial Private Sub OnLoaded()
    End Sub
    Partial Private Sub OnValidate(action As System.Data.Linq.ChangeAction)
    End Sub
    Partial Private Sub OnCreated()
    End Sub
    Partial Private Sub OnIdChanging(value As Integer)
    End Sub
    Partial Private Sub OnIdChanged()
    End Sub
    Partial Private Sub OnDescriptionChanging(value As String)
    End Sub
    Partial Private Sub OnDescriptionChanged()
    End Sub
    Partial Private Sub OnTooltipChanging(value As String)
    End Sub
    Partial Private Sub OnTooltipChanged()
    End Sub
    Partial Private Sub OnImageUrlChanging(value As String)
    End Sub
    Partial Private Sub OnImageUrlChanged()
    End Sub
    Partial Private Sub OnPhotoAlbumIdChanging(value As Integer)
    End Sub
    Partial Private Sub OnPhotoAlbumIdChanged()
    End Sub
    #End Region
	
	Public Sub New()
		MyBase.New
		Me._PhotoAlbum = CType(Nothing, EntityRef(Of PhotoAlbum))
		OnCreated
	End Sub
	
	<Column(Storage:="_Id", AutoSync:=AutoSync.OnInsert, DbType:="Int NOT NULL IDENTITY", IsPrimaryKey:=true, IsDbGenerated:=true)>  _
	Public Property Id() As Integer
		Get
			Return Me._Id
		End Get
		Set
			If ((Me._Id = value)  _
						= false) Then
				Me.OnIdChanging(value)
				Me.SendPropertyChanging
				Me._Id = value
				Me.SendPropertyChanged("Id")
				Me.OnIdChanged
			End If
		End Set
	End Property
	
	<Column(Storage:="_Description", DbType:="NVarChar(300) NOT NULL", CanBeNull:=false)>  _
	Public Property Description() As String
		Get
			Return Me._Description
		End Get
		Set
			If (String.Equals(Me._Description, value) = false) Then
				Me.OnDescriptionChanging(value)
				Me.SendPropertyChanging
				Me._Description = value
				Me.SendPropertyChanged("Description")
				Me.OnDescriptionChanged
			End If
		End Set
	End Property
	
	<Column(Storage:="_Tooltip", DbType:="NVarChar(50) NOT NULL", CanBeNull:=false)>  _
	Public Property Tooltip() As String
		Get
			Return Me._Tooltip
		End Get
		Set
			If (String.Equals(Me._Tooltip, value) = false) Then
				Me.OnTooltipChanging(value)
				Me.SendPropertyChanging
				Me._Tooltip = value
				Me.SendPropertyChanged("Tooltip")
				Me.OnTooltipChanged
			End If
		End Set
	End Property
	
	<Column(Storage:="_ImageUrl", DbType:="NVarChar(200) NOT NULL", CanBeNull:=false)>  _
	Public Property ImageUrl() As String
		Get
			Return Me._ImageUrl
		End Get
		Set
			If (String.Equals(Me._ImageUrl, value) = false) Then
				Me.OnImageUrlChanging(value)
				Me.SendPropertyChanging
				Me._ImageUrl = value
				Me.SendPropertyChanged("ImageUrl")
				Me.OnImageUrlChanged
			End If
		End Set
	End Property
	
	<Column(Storage:="_PhotoAlbumId", DbType:="Int NOT NULL")>  _
	Public Property PhotoAlbumId() As Integer
		Get
			Return Me._PhotoAlbumId
		End Get
		Set
			If ((Me._PhotoAlbumId = value)  _
						= false) Then
				If Me._PhotoAlbum.HasLoadedOrAssignedValue Then
					Throw New System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException
				End If
				Me.OnPhotoAlbumIdChanging(value)
				Me.SendPropertyChanging
				Me._PhotoAlbumId = value
				Me.SendPropertyChanged("PhotoAlbumId")
				Me.OnPhotoAlbumIdChanged
			End If
		End Set
	End Property
	
	<Association(Name:="PhotoAlbum_Picture", Storage:="_PhotoAlbum", ThisKey:="PhotoAlbumId", OtherKey:="Id", IsForeignKey:=true)>  _
	Public Property PhotoAlbum() As PhotoAlbum
		Get
			Return Me._PhotoAlbum.Entity
		End Get
		Set
			Dim previousValue As PhotoAlbum = Me._PhotoAlbum.Entity
			If ((Object.Equals(previousValue, value) = false)  _
						OrElse (Me._PhotoAlbum.HasLoadedOrAssignedValue = false)) Then
				Me.SendPropertyChanging
				If ((previousValue Is Nothing)  _
							= false) Then
					Me._PhotoAlbum.Entity = Nothing
					previousValue.Pictures.Remove(Me)
				End If
				Me._PhotoAlbum.Entity = value
				If ((value Is Nothing)  _
							= false) Then
					value.Pictures.Add(Me)
					Me._PhotoAlbumId = value.Id
				Else
					Me._PhotoAlbumId = CType(Nothing, Integer)
				End If
				Me.SendPropertyChanged("PhotoAlbum")
			End If
		End Set
	End Property
	
	Public Event PropertyChanging As PropertyChangin��ӐWל��ҝu0s�E7��ϧ��8�
Thanks
 
Old November 9th, 2009, 03:54 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Can you post the actual errors you are getting?

And are you sure your new machine has the .NET 3.5 Framework installed? The Picture class is created by LINQ to SQL which is part of .NET 3.5....

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old November 9th, 2009, 01:32 PM
Authorized User
 
Join Date: Oct 2009
Posts: 22
Thanks: 7
Thanked 0 Times in 0 Posts
Default

Hi Imar,

I'm at the internship right now "The Laptop" and of course everything compiles fine. I will post the exact errors when I get back to my home desktop, there are several.

I am 98.9% positive that I have the 3.5 .net framework installed. I assume this is the version included with VS08, correct?


I will be back home around 6:00PM EST


Thank You,


Chuck
 
Old November 9th, 2009, 01:52 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
I assume this is the version included with VS08, correct?
Yes, correct. It gets installed together with VS 2008....

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old November 9th, 2009, 10:37 PM
Authorized User
 
Join Date: Oct 2009
Posts: 22
Thanks: 7
Thanked 0 Times in 0 Posts
Default

Hi Imar,

Finally at the PC. My first son makes it hard to sit down, sorry.
Here are all of the errors. They all occur in the designer file.

Brace yourself....Perhaps "several" was an understatement.

Error 1 'Class' statement must end with a matching 'End Class'. C:\Users\The Blaines\Desktop\PlanetWrox\begASPNET\Site\App_Code \PlanetWrox.designer.vb 601 1 C:\...\Site\

Error 2 Class 'Picture' must implement 'Event PropertyChanging(sender As Object, e As PropertyChangingEventArgs)' for interface 'System.ComponentModel.INotifyPropertyChanging'. C:\Users\The Blaines\Desktop\PlanetWrox\begASPNET\Site\App_Code \PlanetWrox.designer.vb 603 13 C:\...\Site\

Error 3 Class 'Picture' must implement 'Event PropertyChanged(sender As Object, e As PropertyChangedEventArgs)' for interface 'System.ComponentModel.INotifyPropertyChanged'. C:\Users\The Blaines\Desktop\PlanetWrox\begASPNET\Site\App_Code \PlanetWrox.designer.vb 603 60 C:\...\Site\

Error 4 'SendPropertyChanging' is not a member of 'Picture'. C:\Users\The Blaines\Desktop\PlanetWrox\begASPNET\Site\App_Code \PlanetWrox.designer.vb 663 5 C:\...\Site\

Error 5 'SendPropertyChanged' is not a member of 'Picture'. C:\Users\The Blaines\Desktop\PlanetWrox\begASPNET\Site\App_Code \PlanetWrox.designer.vb 665 5 C:\...\Site\

Error 6 'SendPropertyChanging' is not a member of 'Picture'. C:\Users\The Blaines\Desktop\PlanetWrox\begASPNET\Site\App_Code \PlanetWrox.designer.vb 679 5 C:\...\Site\

Error 7 'SendPropertyChanged' is not a member of 'Picture'. C:\Users\The Blaines\Desktop\PlanetWrox\begASPNET\Site\App_Code \PlanetWrox.designer.vb 681 5 C:\...\Site\

Error 8 'SendPropertyChanging' is not a member of 'Picture'. C:\Users\The Blaines\Desktop\PlanetWrox\begASPNET\Site\App_Code \PlanetWrox.designer.vb 695 5 C:\...\Site\

Error 9 'SendPropertyChanged' is not a member of 'Picture'. C:\Users\The Blaines\Desktop\PlanetWrox\begASPNET\Site\App_Code \PlanetWrox.designer.vb 697 5 C:\...\Site\

Error 10 'SendPropertyChanging' is not a member of 'Picture'. C:\Users\The Blaines\Desktop\PlanetWrox\begASPNET\Site\App_Code \PlanetWrox.designer.vb 711 5 C:\...\Site\

Error 11 'SendPropertyChanged' is not a member of 'Picture'. C:\Users\The Blaines\Desktop\PlanetWrox\begASPNET\Site\App_Code \PlanetWrox.designer.vb 713 5 C:\...\Site\

Error 12 'SendPropertyChanging' is not a member of 'Picture'. C:\Users\The Blaines\Desktop\PlanetWrox\begASPNET\Site\App_Code \PlanetWrox.designer.vb 731 5 C:\...\Site\

Error 13 'SendPropertyChanged' is not a member of 'Picture'. C:\Users\The Blaines\Desktop\PlanetWrox\begASPNET\Site\App_Code \PlanetWrox.designer.vb 733 5 C:\...\Site\

Error 14 'SendPropertyChanging' is not a member of 'Picture'. C:\Users\The Blaines\Desktop\PlanetWrox\begASPNET\Site\App_Code \PlanetWrox.designer.vb 748 5 C:\...\Site\

Error 15 'SendPropertyChanged' is not a member of 'Picture'. C:\Users\The Blaines\Desktop\PlanetWrox\begASPNET\Site\App_Code \PlanetWrox.designer.vb 762 5 C:\...\Site\

Error 16 Type 'PropertyChangin' is not defined. C:\Users\The Blaines\Desktop\PlanetWrox\begASPNET\Site\App_Code \PlanetWrox.designer.vb 767 35 C:\...\Site\

Error 17 Character is not valid. C:\Users\The Blaines\Desktop\PlanetWrox\begASPNET\Site\App_Code \PlanetWrox.designer.vb 767 50 C:\...\Site\

Error 18 Declaration expected. C:\Users\The Blaines\Desktop\PlanetWrox\begASPNET\Site\App_Code \PlanetWrox.designer.vb 768 1 C:\...\Site\

Error 19 Declaration expected. C:\Users\The Blaines\Desktop\PlanetWrox\begASPNET\Site\App_Code \PlanetWrox.designer.vb 769 1 C:\...\Site\

Error 20 Declaration expected. C:\Users\The Blaines\Desktop\PlanetWrox\begASPNET\Site\App_Code \PlanetWrox.designer.vb 770 1 C:\...\Site\

Error 21 Character is not valid. C:\Users\The Blaines\Desktop\PlanetWrox\begASPNET\Site\App_Code \PlanetWrox.designer.vb 770 37 C:\...\Site\

Error 22 Character is not valid. C:\Users\The Blaines\Desktop\PlanetWrox\begASPNET\Site\App_Code \PlanetWrox.designer.vb 770 70 C:\...\Site\


That's all of them. Wow I know!

Thanks for any help you can provide,


Chuck
 
Old November 11th, 2009, 01:55 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Chuck,

It looks like the auto generated class cannot be compiled correctly. There could be a few reasons:

1. The file is corrupt (which might explain the strange charatcers you're seeing)

2. .NET is not installed correctly.

3. Something else ;-)

Can you try recreating the LINQ to SQL diagram on the new machine and see if that works?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
eiviery (November 13th, 2009)
 
Old November 11th, 2009, 02:08 PM
Authorized User
 
Join Date: Oct 2009
Posts: 22
Thanks: 7
Thanked 0 Times in 0 Posts
Default

Will do.

I'll have to wait again until I get home this evening to try it out and with the new baby it may be a while before I can work on it. I'll post as soon as I have new information for you.

Thanks again,


Chuck
 
Old November 11th, 2009, 08:55 PM
Authorized User
 
Join Date: Oct 2009
Posts: 22
Thanks: 7
Thanked 0 Times in 0 Posts
Default

Hello Imar,

I am glad to report that rebuilding the LINQ diagram fixed the problem.

What was going wrong?


Chuck
 
Old November 13th, 2009, 04:09 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Difficult to say without seeing the site or files. My guess is that the file was somehow corrupt. Did you try looking at the files that had the problems in Notepad?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old November 13th, 2009, 02:39 PM
Authorized User
 
Join Date: Oct 2009
Posts: 22
Thanks: 7
Thanked 0 Times in 0 Posts
Default

Hi Imar,

No I didn't look at it in notepad. It's fixed now so that won't help anymore but can I do that in the future to find problems?


Chuck





Similar Threads
Thread Thread Starter Forum Replies Last Post
how to complie java program fafa Apache Tomcat 1 June 15th, 2006 05:10 AM
Error when complie SSPI.h file Richy Visual Studio 2005 0 November 17th, 2005 05:18 AM
Another issue islandtiu BOOK: Beginning ASP 3.0 1 February 14th, 2005 11:49 AM
Sub report issue kondapally Crystal Reports 2 February 9th, 2005 11:35 AM
Concurrency Issue billy_bob_the_3rd Classic ASP Components 1 October 23rd, 2004 09:33 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.