 |
| ASP.NET 4 General Discussion For ASP.NET 4 discussions not relating to a specific Wrox book |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 4 General Discussion 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
|
|
|
|

December 12th, 2010, 01:50 AM
|
|
Authorized User
|
|
Join Date: Oct 2009
Posts: 33
Thanks: 7
Thanked 1 Time in 1 Post
|
|
Unable to load the specified metadata resource.
I have been following through pages 482 and 483 of Beginning V4. I have used intelliSense, which has helped greatly with plurals etcetera. Apart from some warnings re using the outdated
construct, I have no errors in building BUT
when I try F5 I get the message
Quote:
|
Unable to load the specified metadata resource.
|
It is pointing at a line within the auto-generated file
How_and_Why_Wonder_Books_Titles.Designer. vb.
The line reads
Code:
MyBase.New("name=How_and_Why_Wonder_BooksEntities", "How_and_Why_Wonder_BooksEntities")
and it appears within the Constructors region, which itself sits within the Contexts region.
I will highlight the line in red and bold below, as it appears within the whole vb file.
As an aside, but maybe this is relevant, I note that while the edmx file is entitled How_and_Why_Wonder_Books.edmx, the auto generated file has the extra _Titles inserted: the only explanation I can come up with is that that is the table in the top left corner of the relationships diagram, but apart from that I don't understand why that 'insertion' is happening.
File generating error
Code:
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated from a template.
'
' Manual changes to this file may cause unexpected behavior in your application.
' Manual changes to this file will be overwritten if the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
Imports System
Imports System.Data.Objects
Imports System.Data.Objects.DataClasses
Imports System.Data.EntityClient
Imports System.ComponentModel
Imports System.Xml.Serialization
Imports System.Runtime.Serialization
<Assembly: EdmSchemaAttribute("72b46a9b-e397-424b-8188-fd66d0ae85fd")>
#Region "EDM Relationship Metadata"
<Assembly: EdmRelationshipAttribute("How_and_Why_Wonder_BooksModel", "FK_DesCode", "Discipline", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, GetType(How_and_Why_Wonder_BooksModel.Discipline), "Title", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, GetType(How_and_Why_Wonder_BooksModel.Title), True)>
<Assembly: EdmRelationshipAttribute("How_and_Why_Wonder_BooksModel", "FK_Series_Publishers_Publishers", "Publisher", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, GetType(How_and_Why_Wonder_BooksModel.Publisher), "Series_Publishers", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, GetType(How_and_Why_Wonder_BooksModel.Series_Publishers), True)>
<Assembly: EdmRelationshipAttribute("How_and_Why_Wonder_BooksModel", "FK_Series_Publishers_Series", "Series", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, GetType(How_and_Why_Wonder_BooksModel.Series), "Series_Publishers", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, GetType(How_and_Why_Wonder_BooksModel.Series_Publishers), True)>
<Assembly: EdmRelationshipAttribute("How_and_Why_Wonder_BooksModel", "FK_Titles_Series_Series", "Series", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, GetType(How_and_Why_Wonder_BooksModel.Series), "Titles_Series", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, GetType(How_and_Why_Wonder_BooksModel.Titles_Series), True)>
<Assembly: EdmRelationshipAttribute("How_and_Why_Wonder_BooksModel", "FK_Titles_Series_Titles", "Title", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, GetType(How_and_Why_Wonder_BooksModel.Title), "Titles_Series", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, GetType(How_and_Why_Wonder_BooksModel.Titles_Series), True)>
#End Region
Namespace How_and_Why_Wonder_BooksModel
#Region "Contexts"
''' <summary>
''' No Metadata Documentation available.
''' </summary>
Public Partial Class How_and_Why_Wonder_BooksEntities
Inherits ObjectContext
#Region "Constructors"
''' <summary>
''' Initializes a new How_and_Why_Wonder_BooksEntities object using the connection string found in the 'How_and_Why_Wonder_BooksEntities' section of the application configuration file.
''' </summary>
Public Sub New()
MyBase.New("name=How_and_Why_Wonder_BooksEntities", "How_and_Why_Wonder_BooksEntities")
MyBase.ContextOptions.LazyLoadingEnabled = true
OnContextCreated()
End Sub
''' <summary>
''' Initialize a new How_and_Why_Wonder_BooksEntities object.
''' </summary>
Public Sub New(ByVal connectionString As String)
MyBase.New(connectionString, "How_and_Why_Wonder_BooksEntities")
MyBase.ContextOptions.LazyLoadingEnabled = true
OnContextCreated()
End Sub
''' <summary>
''' Initialize a new How_and_Why_Wonder_BooksEntities object.
''' </summary>
Public Sub New(ByVal connection As EntityConnection)
MyBase.New(connection, "How_and_Why_Wonder_BooksEntities")
MyBase.ContextOptions.LazyLoadingEnabled = true
OnContextCreated()
End Sub
#End Region
#Region "Partial Methods"
Partial Private Sub OnContextCreated()
End Sub
#End Region
#Region "ObjectSet Properties"
''' <summary>
''' No Metadata Documentation available.
''' </summary>
Public ReadOnly Property Disciplines() As ObjectSet(Of Discipline)
Get
If (_Disciplines Is Nothing) Then
_Disciplines = MyBase.CreateObjectSet(Of Discipline)("Disciplines")
End If
Return _Disciplines
End Get
End Property
Private _Disciplines As ObjectSet(Of Discipline)
''' <summary>
''' No Metadata Documentation available.
''' </summary>
Public ReadOnly Property Publishers() As ObjectSet(Of Publisher)
Get
If (_Publishers Is Nothing) Then
_Publishers = MyBase.CreateObjectSet(Of Publisher)("Publishers")
End If
Return _Publishers
End Get
End Property
Private _Publishers As ObjectSet(Of Publisher)
''' <summary>
''' No Metadata Documentation available.
''' </summary>
Public ReadOnly Property Series() As ObjectSet(Of Series)
Get
If (_Series Is Nothing) Then
_Series = MyBase.CreateObjectSet(Of Series)("Series")
End If
Return _Series
End Get
End Property
Private _Series As ObjectSet(Of Series)
''' <summary>
''' No Metadata Documentation available.
''' </summary>
Public ReadOnly Property Series_Publishers() As ObjectSet(Of Series_Publishers)
Get
If (_Series_Publishers Is Nothing) Then
_Series_Publishers = MyBase.CreateObjectSet(Of Series_Publishers)("Series_Publishers")
End If
Return _Series_Publishers
End Get
End Property
Private _Series_Publishers As ObjectSet(Of Series_Publishers)
''' <summary>
''' No Metadata Documentation available.
''' </summary>
Public ReadOnly Property Titles() As ObjectSet(Of Title)
Get
If (_Titles Is Nothing) Then
_Titles = MyBase.CreateObjectSet(Of Title)("Titles")
End If
Return _Titles
End Get
End Property
Private _Titles As ObjectSet(Of Title)
''' <summary>
''' No Metadata Documentation available.
''' </summary>
Public ReadOnly Property Titles_Series() As ObjectSet(Of Titles_Series)
Get
If (_Titles_Series Is Nothing) Then
_Titles_Series = MyBase.CreateObjectSet(Of Titles_Series)("Titles_Series")
End If
Return _Titles_Series
End Get
End Property
Private _Titles_Series As ObjectSet(Of Titles_Series)
#End Region
#Region "AddTo Methods"
''' <summary>
''' Deprecated Method for adding a new object to the Disciplines EntitySet. Consider using the .Add method of the associated ObjectSet(Of T) property instead.
''' </summary>
Public Sub AddToDisciplines(ByVal discipline As Discipline)
MyBase.AddObject("Disciplines", discipline)
End Sub
''' <summary>
''' Deprecated Method for adding a new object to the Publishers EntitySet. Consider using the .Add method of the associated ObjectSet(Of T) property instead.
''' </summary>
Public Sub AddToPublishers(ByVal publisher As Publisher)
MyBase.AddObject("Publishers", publisher)
End Sub
''' <summary>
''' Deprecated Method for adding a new object to the Series EntitySet. Consider using the .Add method of the associated ObjectSet(Of T) property instead.
''' </summary>
Public Sub AddToSeries(ByVal series As Series)
MyBase.AddObject("Series", series)
End Sub
''' <summary>
''' Deprecated Method for adding a new object to the Series_Publishers EntitySet. Consider using the .Add method of the associated ObjectSet(Of T) property instead.
''' </summary>
Public Sub AddToSeries_Publishers(ByVal series_Publishers As Series_Publishers)
MyBase.AddObject("Series_Publishers", series_Publishers)
End Sub
''' <summary>
''' Deprecated Method for adding a new object to the Titles EntitySet. Consider using the .Add method of the associated ObjectSet(Of T) property instead.
''' </summary>
Public Sub AddToTitles(ByVal title As Title)
MyBase.AddObject("Titles", title)
End Sub
''' <summary>
''' Deprecated Method for adding a new object to the Titles_Series EntitySet. Consider using the .Add method of the associated ObjectSet(Of T) property instead.
''' </summary>
Public Sub AddToTitles_Series(ByVal titles_Series As Titles_Series)
MyBase.AddObject("Titles_Series", titles_Series)
End Sub
#End Region
End Class
#End Region
#Region "Entities"
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<EdmEntityTypeAttribute(NamespaceName:="How_and_Why_Wonder_BooksModel", Name:="Discipline")>
<Serializable()>
<DataContractAttribute(IsReference:=True)>
Public Partial Class Discipline
Inherits EntityObject
#Region "Factory Method"
''' <summary>
''' Create a new Discipline object.
''' </summary>
''' <param name="discipline_Code">Initial value of the Discipline_Code property.</param>
Public Shared Function CreateDiscipline(discipline_Code As Global.System.String) As Discipline
Dim discipline as Discipline = New Discipline
discipline.Discipline_Code = discipline_Code
Return discipline
End Function
#End Region
#Region "Primitive Properties"
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<EdmScalarPropertyAttribute(EntityKeyProperty:=true, IsNullable:=false)>
<DataMemberAttribute()>
Public Property Discipline_Code() As Global.System.String
Get
Return _Discipline_Code
End Get
Set
If (_Discipline_Code <> Value) Then
OnDiscipline_CodeChanging(value)
ReportPropertyChanging("Discipline_Code")
_Discipline_Code = StructuralObject.SetValidValue(value, false)
ReportPropertyChanged("Discipline_Code")
OnDiscipline_CodeChanged()
End If
End Set
End Property
Private _Discipline_Code As Global.System.String
Private Partial Sub OnDiscipline_CodeChanging(value As Global.System.String)
End Sub
Private Partial Sub OnDiscipline_CodeChanged()
End Sub
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
<DataMemberAttribute()>
Public Property Discipline_Name() As Global.System.String
Get
Return _Discipline_Name
End Get
Set
OnDiscipline_NameChanging(value)
ReportPropertyChanging("Discipline_Name")
_Discipline_Name = StructuralObject.SetValidValue(value, true)
ReportPropertyChanged("Discipline_Name")
OnDiscipline_NameChanged()
End Set
End Property
Private _Discipline_Name As Global.System.String
Private Partial Sub OnDiscipline_NameChanging(value As Global.System.String)
End Sub
Private Partial Sub OnDiscipline_NameChanged()
End Sub
#End Region
#Region "Navigation Properties"
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<XmlIgnoreAttribute()>
<SoapIgnoreAttribute()>
<DataMemberAttribute()>
<EdmRelationshipNavigationPropertyAttribute("How_and_Why_Wonder_BooksModel", "FK_DesCode", "Title")>
Public Property Titles() As EntityCollection(Of Title)
Get
Return CType(Me,IEntityWithRelationships).RelationshipManager.GetRelatedCollection(Of Title)("How_and_Why_Wonder_BooksModel.FK_DesCode", "Title")
End Get
Set
If (Not value Is Nothing)
CType(Me, IEntityWithRelationships).RelationshipManager.InitializeRelatedCollection(Of Title)("How_and_Why_Wonder_BooksModel.FK_DesCode", "Title", value)
End If
End Set
End Property
#End Region
End Class
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<EdmEntityTypeAttribute(NamespaceName:="How_and_Why_Wonder_BooksModel", Name:="Publisher")>
<Serializable()>
<DataContractAttribute(IsReference:=True)>
Public Partial Class Publisher
Inherits EntityObject
#Region "Factory Method"
''' <summary>
''' Create a new Publisher object.
''' </summary>
''' <param name="publisher_ID">Initial value of the Publisher_ID property.</param>
Public Shared Function CreatePublisher(publisher_ID As Global.System.Int32) As Publisher
Dim publisher as Publisher = New Publisher
publisher.Publisher_ID = publisher_ID
Return publisher
End Function
#End Region
#Region "Primitive Properties"
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<EdmScalarPropertyAttribute(EntityKeyProperty:=true, IsNullable:=false)>
<DataMemberAttribute()>
Public Property Publisher_ID() As Global.System.Int32
Get
Return _Publisher_ID
End Get
Set
If (_Publisher_ID <> Value) Then
OnPublisher_IDChanging(value)
ReportPropertyChanging("Publisher_ID")
_Publisher_ID = StructuralObject.SetValidValue(value)
ReportPropertyChanged("Publisher_ID")
OnPublisher_IDChanged()
End If
End Set
End Property
Private _Publisher_ID As Global.System.Int32
Private Partial Sub OnPublisher_IDChanging(value As Global.System.Int32)
End Sub
Private Partial Sub OnPublisher_IDChanged()
End Sub
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
<DataMemberAttribute()>
Public Property Publisher_Name() As Global.System.String
Get
Return _Publisher_Name
End Get
Set
OnPublisher_NameChanging(value)
ReportPropertyChanging("Publisher_Name")
_Publisher_Name = StructuralObject.SetValidValue(value, true)
ReportPropertyChanged("Publisher_Name")
OnPublisher_NameChanged()
End Set
End Property
Private _Publisher_Name As Global.System.String
Private Partial Sub OnPublisher_NameChanging(value As Global.System.String)
End Sub
Private Partial Sub OnPublisher_NameChanged()
End Sub
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
<DataMemberAttribute()>
Public Property Series_Published() As Global.System.String
Get
Return _Series_Published
End Get
Set
OnSeries_PublishedChanging(value)
ReportPropertyChanging("Series_Published")
_Series_Published = StructuralObject.SetValidValue(value, true)
ReportPropertyChanged("Series_Published")
OnSeries_PublishedChanged()
End Set
End Property
Private _Series_Published As Global.System.String
Private Partial Sub OnSeries_PublishedChanging(value As Global.System.String)
End Sub
Private Partial Sub OnSeries_PublishedChanged()
End Sub
#End Region
#Region "Navigation Properties"
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<XmlIgnoreAttribute()>
<SoapIgnoreAttribute()>
<DataMemberAttribute()>
<EdmRelationshipNavigationPropertyAttribute("How_and_Why_Wonder_BooksModel", "FK_Series_Publishers_Publishers", "Series_Publishers")>
Public Property Series_Publishers() As EntityCollection(Of Series_Publishers)
Get
Return CType(Me,IEntityWithRelationships).RelationshipManager.GetRelatedCollection(Of Series_Publishers)("How_and_Why_Wonder_BooksModel.FK_Series_Publishers_Publishers", "Series_Publishers")
End Get
Set
If (Not value Is Nothing)
CType(Me, IEntityWithRelationships).RelationshipManager.InitializeRelatedCollection(Of Series_Publishers)("How_and_Why_Wonder_BooksModel.FK_Series_Publishers_Publishers", "Series_Publishers", value)
End If
End Set
End Property
#End Region
End Class
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<EdmEntityTypeAttribute(NamespaceName:="How_and_Why_Wonder_BooksModel", Name:="Series")>
<Serializable()>
<DataContractAttribute(IsReference:=True)>
Public Partial Class Series
Inherits EntityObject
#Region "Factory Method"
''' <summary>
''' Create a new Series object.
''' </summary>
''' <param name="series_ID">Initial value of the Series_ID property.</param>
Public Shared Function CreateSeries(series_ID As Global.System.String) As Series
Dim series as Series = New Series
series.Series_ID = series_ID
Return series
End Function
#End Region
#Region "Primitive Properties"
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<EdmScalarPropertyAttribute(EntityKeyProperty:=true, IsNullable:=false)>
<DataMemberAttribute()>
Public Property Series_ID() As Global.System.String
Get
Return _Series_ID
End Get
Set
If (_Series_ID <> Value) Then
OnSeries_IDChanging(value)
ReportPropertyChanging("Series_ID")
_Series_ID = StructuralObject.SetValidValue(value, false)
ReportPropertyChanged("Series_ID")
OnSeries_IDChanged()
End If
End Set
End Property
Private _Series_ID As Global.System.String
Private Partial Sub OnSeries_IDChanging(value As Global.System.String)
End Sub
Private Partial Sub OnSeries_IDChanged()
End Sub
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
<DataMemberAttribute()>
Public Property Series_Name() As Global.System.String
Get
Return _Series_Name
End Get
Set
OnSeries_NameChanging(value)
ReportPropertyChanging("Series_Name")
_Series_Name = StructuralObject.SetValidValue(value, true)
ReportPropertyChanged("Series_Name")
OnSeries_NameChanged()
End Set
End Property
Private _Series_Name As Global.System.String
Private Partial Sub OnSeries_NameChanging(value As Global.System.String)
End Sub
Private Partial Sub OnSeries_NameChanged()
End Sub
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
<DataMemberAttribute()>
Public Property Back_Cover_JPEG() As Global.System.String
Get
Return _Back_Cover_JPEG
End Get
Set
OnBack_Cover_JPEGChanging(value)
ReportPropertyChanging("Back_Cover_JPEG")
_Back_Cover_JPEG = StructuralObject.SetValidValue(value, true)
ReportPropertyChanged("Back_Cover_JPEG")
OnBack_Cover_JPEGChanged()
End Set
End Property
Private _Back_Cover_JPEG As Global.System.String
Private Partial Sub OnBack_Cover_JPEGChanging(value As Global.System.String)
End Sub
Private Partial Sub OnBack_Cover_JPEGChanged()
End Sub
#End Region
#Region "Navigation Properties"
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<XmlIgnoreAttribute()>
<SoapIgnoreAttribute()>
<DataMemberAttribute()>
<EdmRelationshipNavigationPropertyAttribute("How_and_Why_Wonder_BooksModel", "FK_Series_Publishers_Series", "Series_Publishers")>
Public Property Series_Publishers() As EntityCollection(Of Series_Publishers)
Get
Return CType(Me,IEntityWithRelationships).RelationshipManager.GetRelatedCollection(Of Series_Publishers)("How_and_Why_Wonder_BooksModel.FK_Series_Publishers_Series", "Series_Publishers")
End Get
Set
If (Not value Is Nothing)
CType(Me, IEntityWithRelationships).RelationshipManager.InitializeRelatedCollection(Of Series_Publishers)("How_and_Why_Wonder_BooksModel.FK_Series_Publishers_Series", "Series_Publishers", value)
End If
End Set
End Property
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<XmlIgnoreAttribute()>
<SoapIgnoreAttribute()>
<DataMemberAttribute()>
<EdmRelationshipNavigationPropertyAttribute("How_and_Why_Wonder_BooksModel", "FK_Titles_Series_Series", "Titles_Series")>
Public Property Titles_Series() As EntityCollection(Of Titles_Series)
Get
Return CType(Me,IEntityWithRelationships).RelationshipManager.GetRelatedCollection(Of Titles_Series)("How_and_Why_Wonder_BooksModel.FK_Titles_Series_Series", "Titles_Series")
End Get
Set
If (Not value Is Nothing)
CType(Me, IEntityWithRelationships).RelationshipManager.InitializeRelatedCollection(Of Titles_Series)("How_and_Why_Wonder_BooksModel.FK_Titles_Series_Series", "Titles_Series", value)
End If
End Set
End Property
#End Region
End Class
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<EdmEntityTypeAttribute(NamespaceName:="How_and_Why_Wonder_BooksModel", Name:="Series_Publishers")>
<Serializable()>
<DataContractAttribute(IsReference:=True)>
Public Partial Class Series_Publishers
Inherits EntityObject
#Region "Factory Method"
''' <summary>
''' Create a new Series_Publishers object.
''' </summary>
''' <param name="ser_Pub_Rec_Num">Initial value of the Ser_Pub_Rec_Num property.</param>
Public Shared Function CreateSeries_Publishers(ser_Pub_Rec_Num As Global.System.Int32) As Series_Publishers
Dim series_Publishers as Series_Publishers = New Series_Publishers
series_Publishers.Ser_Pub_Rec_Num = ser_Pub_Rec_Num
Return series_Publishers
End Function
#End Region
#Region "Primitive Properties"
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<EdmScalarPropertyAttribute(EntityKeyProperty:=true, IsNullable:=false)>
<DataMemberAttribute()>
Public Property Ser_Pub_Rec_Num() As Global.System.Int32
Get
Return _Ser_Pub_Rec_Num
End Get
Set
If (_Ser_Pub_Rec_Num <> Value) Then
OnSer_Pub_Rec_NumChanging(value)
ReportPropertyChanging("Ser_Pub_Rec_Num")
_Ser_Pub_Rec_Num = StructuralObject.SetValidValue(value)
ReportPropertyChanged("Ser_Pub_Rec_Num")
OnSer_Pub_Rec_NumChanged()
End If
End Set
End Property
Private _Ser_Pub_Rec_Num As Global.System.Int32
Private Partial Sub OnSer_Pub_Rec_NumChanging(value As Global.System.Int32)
End Sub
Private Partial Sub OnSer_Pub_Rec_NumChanged()
End Sub
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
<DataMemberAttribute()>
Public Property Series_ID() As Global.System.String
Get
Return _Series_ID
End Get
Set
OnSeries_IDChanging(value)
ReportPropertyChanging("Series_ID")
_Series_ID = StructuralObject.SetValidValue(value, true)
ReportPropertyChanged("Series_ID")
OnSeries_IDChanged()
End Set
End Property
Private _Series_ID As Global.System.String
Private Partial Sub OnSeries_IDChanging(value As Global.System.String)
End Sub
Private Partial Sub OnSeries_IDChanged()
End Sub
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
<DataMemberAttribute()>
Public Property Publisher_ID() As Nullable(Of Global.System.Int32)
Get
Return _Publisher_ID
End Get
Set
OnPublisher_IDChanging(value)
ReportPropertyChanging("Publisher_ID")
_Publisher_ID = StructuralObject.SetValidValue(value)
ReportPropertyChanged("Publisher_ID")
OnPublisher_IDChanged()
End Set
End Property
Private _Publisher_ID As Nullable(Of Global.System.Int32)
Private Partial Sub OnPublisher_IDChanging(value As Nullable(Of Global.System.Int32))
End Sub
Private Partial Sub OnPublisher_IDChanged()
End Sub
#End Region
#Region "Navigation Properties"
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<XmlIgnoreAttribute()>
<SoapIgnoreAttribute()>
<DataMemberAttribute()>
<EdmRelationshipNavigationPropertyAttribute("How_and_Why_Wonder_BooksModel", "FK_Series_Publishers_Publishers", "Publisher")>
Public Property Publisher() As Publisher
Get
Return CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of Publisher)("How_and_Why_Wonder_BooksModel.FK_Series_Publishers_Publishers", "Publisher").Value
End Get
Set
CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of Publisher)("How_and_Why_Wonder_BooksModel.FK_Series_Publishers_Publishers", "Publisher").Value = value
End Set
End Property
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<BrowsableAttribute(False)>
<DataMemberAttribute()>
Public Property PublisherReference() As EntityReference(Of Publisher)
Get
Return CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of Publisher)("How_and_Why_Wonder_BooksModel.FK_Series_Publishers_Publishers", "Publisher")
End Get
Set
If (Not value Is Nothing)
CType(Me, IEntityWithRelationships).RelationshipManager.InitializeRelatedReference(Of Publisher)("How_and_Why_Wonder_BooksModel.FK_Series_Publishers_Publishers", "Publisher", value)
End If
End Set
End Property
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<XmlIgnoreAttribute()>
<SoapIgnoreAttribute()>
<DataMemberAttribute()>
<EdmRelationshipNavigationPropertyAttribute("How_and_Why_Wonder_BooksModel", "FK_Series_Publishers_Series", "Series")>
Public Property Series() As Series
Get
Return CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of Series)("How_and_Why_Wonder_BooksModel.FK_Series_Publishers_Series", "Series").Value
End Get
Set
CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of Series)("How_and_Why_Wonder_BooksModel.FK_Series_Publishers_Series", "Series").Value = value
End Set
End Property
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<BrowsableAttribute(False)>
<DataMemberAttribute()>
Public Property SeriesReference() As EntityReference(Of Series)
Get
Return CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of Series)("How_and_Why_Wonder_BooksModel.FK_Series_Publishers_Series", "Series")
End Get
Set
If (Not value Is Nothing)
CType(Me, IEntityWithRelationships).RelationshipManager.InitializeRelatedReference(Of Series)("How_and_Why_Wonder_BooksModel.FK_Series_Publishers_Series", "Series", value)
End If
End Set
End Property
#End Region
End Class
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<EdmEntityTypeAttribute(NamespaceName:="How_and_Why_Wonder_BooksModel", Name:="Title")>
<Serializable()>
<DataContractAttribute(IsReference:=True)>
Public Partial Class Title
Inherits EntityObject
#Region "Factory Method"
''' <summary>
''' Create a new Title object.
''' </summary>
''' <param name="title_ID">Initial value of the Title_ID property.</param>
Public Shared Function CreateTitle(title_ID As Global.System.Int32) As Title
Dim title as Title = New Title
title.Title_ID = title_ID
Return title
End Function
#End Region
#Region "Primitive Properties"
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<EdmScalarPropertyAttribute(EntityKeyProperty:=true, IsNullable:=false)>
<DataMemberAttribute()>
Public Property Title_ID() As Global.System.Int32
Get
Return _Title_ID
End Get
Set
If (_Title_ID <> Value) Then
OnTitle_IDChanging(value)
ReportPropertyChanging("Title_ID")
_Title_ID = StructuralObject.SetValidValue(value)
ReportPropertyChanged("Title_ID")
OnTitle_IDChanged()
End If
End Set
End Property
Private _Title_ID As Global.System.Int32
Private Partial Sub OnTitle_IDChanging(value As Global.System.Int32)
End Sub
Private Partial Sub OnTitle_IDChanged()
End Sub
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
<DataMemberAttribute()>
Public Property Book_Title() As Global.System.String
Get
Return _Book_Title
End Get
Set
OnBook_TitleChanging(value)
ReportPropertyChanging("Book_Title")
_Book_Title = StructuralObject.SetValidValue(value, true)
ReportPropertyChanged("Book_Title")
OnBook_TitleChanged()
End Set
End Property
Private _Book_Title As Global.System.String
Private Partial Sub OnBook_TitleChanging(value As Global.System.String)
End Sub
Private Partial Sub OnBook_TitleChanged()
End Sub
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
<DataMemberAttribute()>
Public Property Series_Available() As Global.System.String
Get
Return _Series_Available
End Get
Set
OnSeries_AvailableChanging(value)
ReportPropertyChanging("Series_Available")
_Series_Available = StructuralObject.SetValidValue(value, true)
ReportPropertyChanged("Series_Available")
OnSeries_AvailableChanged()
End Set
End Property
Private _Series_Available As Global.System.String
Private Partial Sub OnSeries_AvailableChanging(value As Global.System.String)
End Sub
Private Partial Sub OnSeries_AvailableChanged()
End Sub
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
<DataMemberAttribute()>
Public Property Available() As Global.System.String
Get
Return _Available
End Get
Set
OnAvailableChanging(value)
ReportPropertyChanging("Available")
_Available = StructuralObject.SetValidValue(value, true)
ReportPropertyChanged("Available")
OnAvailableChanged()
End Set
End Property
Private _Available As Global.System.String
Private Partial Sub OnAvailableChanging(value As Global.System.String)
End Sub
Private Partial Sub OnAvailableChanged()
End Sub
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
<DataMemberAttribute()>
Public Property Authors_UK() As Global.System.String
Get
Return _Authors_UK
End Get
Set
OnAuthors_UKChanging(value)
ReportPropertyChanging("Authors_UK")
_Authors_UK = StructuralObject.SetValidValue(value, true)
ReportPropertyChanged("Authors_UK")
OnAuthors_UKChanged()
End Set
End Property
Private _Authors_UK As Global.System.String
Private Partial Sub OnAuthors_UKChanging(value As Global.System.String)
End Sub
Private Partial Sub OnAuthors_UKChanged()
End Sub
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
<DataMemberAttribute()>
Public Property Illustrators_UK() As Global.System.String
Get
Return _Illustrators_UK
End Get
Set
OnIllustrators_UKChanging(value)
ReportPropertyChanging("Illustrators_UK")
_Illustrators_UK = StructuralObject.SetValidValue(value, true)
ReportPropertyChanged("Illustrators_UK")
OnIllustrators_UKChanged()
End Set
End Property
Private _Illustrators_UK As Global.System.String
Private Partial Sub OnIllustrators_UKChanging(value As Global.System.String)
End Sub
Private Partial Sub OnIllustrators_UKChanged()
End Sub
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
<DataMemberAttribute()>
Public Property Authors_USA() As Global.System.String
Get
Return _Authors_USA
End Get
Set
OnAuthors_USAChanging(value)
ReportPropertyChanging("Authors_USA")
_Authors_USA = StructuralObject.SetValidValue(value, true)
ReportPropertyChanged("Authors_USA")
OnAuthors_USAChanged()
End Set
End Property
Private _Authors_USA As Global.System.String
Private Partial Sub OnAuthors_USAChanging(value As Global.System.String)
End Sub
Private Partial Sub OnAuthors_USAChanged()
End Sub
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
<DataMemberAttribute()>
Public Property Illustrators_USA() As Global.System.String
Get
Return _Illustrators_USA
End Get
Set
OnIllustrators_USAChanging(value)
ReportPropertyChanging("Illustrators_USA")
_Illustrators_USA = StructuralObject.SetValidValue(value, true)
ReportPropertyChanged("Illustrators_USA")
OnIllustrators_USAChanged()
End Set
End Property
Private _Illustrators_USA As Global.System.String
Private Partial Sub OnIllustrators_USAChanging(value As Global.System.String)
End Sub
Private Partial Sub OnIllustrators_USAChanged()
End Sub
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
<DataMemberAttribute()>
Public Property Book_Numbers() As Global.System.String
Get
Return _Book_Numbers
End Get
Set
OnBook_NumbersChanging(value)
ReportPropertyChanging("Book_Numbers")
_Book_Numbers = StructuralObject.SetValidValue(value, true)
ReportPropertyChanged("Book_Numbers")
OnBook_NumbersChanged()
End Set
End Property
Private _Book_Numbers As Global.System.String
Private Partial Sub OnBook_NumbersChanging(value As Global.System.String)
End Sub
Private Partial Sub OnBook_NumbersChanged()
End Sub
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
<DataMemberAttribute()>
Public Property ISBNs() As Global.System.String
Get
Return _ISBNs
End Get
Set
OnISBNsChanging(value)
ReportPropertyChanging("ISBNs")
_ISBNs = StructuralObject.SetValidValue(value, true)
ReportPropertyChanged("ISBNs")
OnISBNsChanged()
End Set
End Property
Private _ISBNs As Global.System.String
Private Partial Sub OnISBNsChanging(value As Global.System.String)
End Sub
Private Partial Sub OnISBNsChanged()
End Sub
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
<DataMemberAttribute()>
Public Property Publication_Dates() As Global.System.String
Get
Return _Publication_Dates
End Get
Set
OnPublication_DatesChanging(value)
ReportPropertyChanging("Publication_Dates")
_Publication_Dates = StructuralObject.SetValidValue(value, true)
ReportPropertyChanged("Publication_Dates")
OnPublication_DatesChanged()
End Set
End Property
Private _Publication_Dates As Global.System.String
Private Partial Sub OnPublication_DatesChanging(value As Global.System.String)
End Sub
Private Partial Sub OnPublication_DatesChanged()
End Sub
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
<DataMemberAttribute()>
Public Property Front_Cover_JPEGs() As Global.System.String
Get
Return _Front_Cover_JPEGs
End Get
Set
OnFront_Cover_JPEGsChanging(value)
ReportPropertyChanging("Front_Cover_JPEGs")
_Front_Cover_JPEGs = StructuralObject.SetValidValue(value, true)
ReportPropertyChanged("Front_Cover_JPEGs")
OnFront_Cover_JPEGsChanged()
End Set
End Property
Private _Front_Cover_JPEGs As Global.System.String
Private Partial Sub OnFront_Cover_JPEGsChanging(value As Global.System.String)
End Sub
Private Partial Sub OnFront_Cover_JPEGsChanged()
End Sub
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
<DataMemberAttribute()>
Public Property Discipline_Code() As Global.System.String
Get
Return _Discipline_Code
End Get
Set
OnDiscipline_CodeChanging(value)
ReportPropertyChanging("Discipline_Code")
_Discipline_Code = StructuralObject.SetValidValue(value, true)
ReportPropertyChanged("Discipline_Code")
OnDiscipline_CodeChanged()
End Set
End Property
Private _Discipline_Code As Global.System.String
Private Partial Sub OnDiscipline_CodeChanging(value As Global.System.String)
End Sub
Private Partial Sub OnDiscipline_CodeChanged()
End Sub
#End Region
#Region "Navigation Properties"
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<XmlIgnoreAttribute()>
<SoapIgnoreAttribute()>
<DataMemberAttribute()>
<EdmRelationshipNavigationPropertyAttribute("How_and_Why_Wonder_BooksModel", "FK_DesCode", "Discipline")>
Public Property Discipline() As Discipline
Get
Return CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of Discipline)("How_and_Why_Wonder_BooksModel.FK_DesCode", "Discipline").Value
End Get
Set
CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of Discipline)("How_and_Why_Wonder_BooksModel.FK_DesCode", "Discipline").Value = value
End Set
End Property
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<BrowsableAttribute(False)>
<DataMemberAttribute()>
Public Property DisciplineReference() As EntityReference(Of Discipline)
Get
Return CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of Discipline)("How_and_Why_Wonder_BooksModel.FK_DesCode", "Discipline")
End Get
Set
If (Not value Is Nothing)
CType(Me, IEntityWithRelationships).RelationshipManager.InitializeRelatedReference(Of Discipline)("How_and_Why_Wonder_BooksModel.FK_DesCode", "Discipline", value)
End If
End Set
End Property
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<XmlIgnoreAttribute()>
<SoapIgnoreAttribute()>
<DataMemberAttribute()>
<EdmRelationshipNavigationPropertyAttribute("How_and_Why_Wonder_BooksModel", "FK_Titles_Series_Titles", "Titles_Series")>
Public Property Titles_Series() As EntityCollection(Of Titles_Series)
Get
Return CType(Me,IEntityWithRelationships).RelationshipManager.GetRelatedCollection(Of Titles_Series)("How_and_Why_Wonder_BooksModel.FK_Titles_Series_Titles", "Titles_Series")
End Get
Set
If (Not value Is Nothing)
CType(Me, IEntityWithRelationships).RelationshipManager.InitializeRelatedCollection(Of Titles_Series)("How_and_Why_Wonder_BooksModel.FK_Titles_Series_Titles", "Titles_Series", value)
End If
End Set
End Property
#End Region
End Class
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<EdmEntityTypeAttribute(NamespaceName:="How_and_Why_Wonder_BooksModel", Name:="Titles_Series")>
<Serializable()>
<DataContractAttribute(IsReference:=True)>
Public Partial Class Titles_Series
Inherits EntityObject
#Region "Factory Method"
''' <summary>
''' Create a new Titles_Series object.
''' </summary>
''' <param name="tit_Ser_Rec_Num">Initial value of the Tit_Ser_Rec_Num property.</param>
Public Shared Function CreateTitles_Series(tit_Ser_Rec_Num As Global.System.Int32) As Titles_Series
Dim titles_Series as Titles_Series = New Titles_Series
titles_Series.Tit_Ser_Rec_Num = tit_Ser_Rec_Num
Return titles_Series
End Function
#End Region
#Region "Primitive Properties"
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<EdmScalarPropertyAttribute(EntityKeyProperty:=true, IsNullable:=false)>
<DataMemberAttribute()>
Public Property Tit_Ser_Rec_Num() As Global.System.Int32
Get
Return _Tit_Ser_Rec_Num
End Get
Set
If (_Tit_Ser_Rec_Num <> Value) Then
OnTit_Ser_Rec_NumChanging(value)
ReportPropertyChanging("Tit_Ser_Rec_Num")
_Tit_Ser_Rec_Num = StructuralObject.SetValidValue(value)
ReportPropertyChanged("Tit_Ser_Rec_Num")
OnTit_Ser_Rec_NumChanged()
End If
End Set
End Property
Private _Tit_Ser_Rec_Num As Global.System.Int32
Private Partial Sub OnTit_Ser_Rec_NumChanging(value As Global.System.Int32)
End Sub
Private Partial Sub OnTit_Ser_Rec_NumChanged()
End Sub
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
<DataMemberAttribute()>
Public Property Title_ID() As Nullable(Of Global.System.Int32)
Get
Return _Title_ID
End Get
Set
OnTitle_IDChanging(value)
ReportPropertyChanging("Title_ID")
_Title_ID = StructuralObject.SetValidValue(value)
ReportPropertyChanged("Title_ID")
OnTitle_IDChanged()
End Set
End Property
Private _Title_ID As Nullable(Of Global.System.Int32)
Private Partial Sub OnTitle_IDChanging(value As Nullable(Of Global.System.Int32))
End Sub
Private Partial Sub OnTitle_IDChanged()
End Sub
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
<DataMemberAttribute()>
Public Property Series_ID() As Global.System.String
Get
Return _Series_ID
End Get
Set
OnSeries_IDChanging(value)
ReportPropertyChanging("Series_ID")
_Series_ID = StructuralObject.SetValidValue(value, true)
ReportPropertyChanged("Series_ID")
OnSeries_IDChanged()
End Set
End Property
Private _Series_ID As Global.System.String
Private Partial Sub OnSeries_IDChanging(value As Global.System.String)
End Sub
Private Partial Sub OnSeries_IDChanged()
End Sub
#End Region
#Region "Navigation Properties"
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<XmlIgnoreAttribute()>
<SoapIgnoreAttribute()>
<DataMemberAttribute()>
<EdmRelationshipNavigationPropertyAttribute("How_and_Why_Wonder_BooksModel", "FK_Titles_Series_Series", "Series")>
Public Property Series() As Series
Get
Return CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of Series)("How_and_Why_Wonder_BooksModel.FK_Titles_Series_Series", "Series").Value
End Get
Set
CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of Series)("How_and_Why_Wonder_BooksModel.FK_Titles_Series_Series", "Series").Value = value
End Set
End Property
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<BrowsableAttribute(False)>
<DataMemberAttribute()>
Public Property SeriesReference() As EntityReference(Of Series)
Get
Return CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of Series)("How_and_Why_Wonder_BooksModel.FK_Titles_Series_Series", "Series")
End Get
Set
If (Not value Is Nothing)
CType(Me, IEntityWithRelationships).RelationshipManager.InitializeRelatedReference(Of Series)("How_and_Why_Wonder_BooksModel.FK_Titles_Series_Series", "Series", value)
End If
End Set
End Property
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<XmlIgnoreAttribute()>
<SoapIgnoreAttribute()>
<DataMemberAttribute()>
<EdmRelationshipNavigationPropertyAttribute("How_and_Why_Wonder_BooksModel", "FK_Titles_Series_Titles", "Title")>
Public Property Title() As Title
Get
Return CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of Title)("How_and_Why_Wonder_BooksModel.FK_Titles_Series_Titles", "Title").Value
End Get
Set
CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of Title)("How_and_Why_Wonder_BooksModel.FK_Titles_Series_Titles", "Title").Value = value
End Set
End Property
''' <summary>
''' No Metadata Documentation available.
''' </summary>
<BrowsableAttribute(False)>
<DataMemberAttribute()>
Public Property TitleReference() As EntityReference(Of Title)
Get
Return CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of Title)("How_and_Why_Wonder_BooksModel.FK_Titles_Series_Titles", "Title")
End Get
Set
If (Not value Is Nothing)
CType(Me, IEntityWithRelationships).RelationshipManager.InitializeRelatedReference(Of Title)("How_and_Why_Wonder_BooksModel.FK_Titles_Series_Titles", "Title", value)
End If
End Set
End Property
#End Region
End Class
#End Region
End Namespace
I'm not at all sure what I need to be fixing, as this code is auto-generated, and warns against manually editing it.
The vb file for the page I am trying to test is as follows -
Code:
Imports How_and_Why_Wonder_BooksModel
Partial Class _Publishers
Inherits BasePage
Protected Sub PageLoad(ByVal sender As Object, ByVal e As System.EventArgs) _
Handles Me.Load
Using myEntities As New How_and_Why_Wonder_BooksEntities()
Dim allPublishers = From Publisher In myEntities.Publishers
Select Publisher
GridView1.DataSource = allPublishers
GridView1.DataBind()
End Using
End Sub
End Class
Any ideas please.
|
|

December 12th, 2010, 06:52 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi there,
I doubt this has anything to do with the generated code. I think it's - just as pretty much all of your other posts to this forum - related to a messed up connection string. I don't know what exactlty you do each time to break your connection strrings over and over again, but the error message to me suggests that the connection string used by your EF context doesn't contain a valid reference to the embedded meta data EF needs.
To fix this, and understand how it works, follow my advice from here: 'System.InvalidOperationException' and 'Instance failure'
That is, create a brand new site, add a model (and remember its Entities Name and Namespace) and save all changes. Then, in the otherwise empty config file you find a connection string for EF that contains information about where to find the embedded meta data. By looking at the model name, namespace, connection string name, and references to the meta data in the EF connection string you may get a better feeling of how things fit together. If that doesn't shed any light, go get yourself a copy of Programming Entity Framework Second Edition by Julia Lerman.
My guess is that either the correct EF data is missing from the connection string, or it's pointing to old or invalid meta data (renamed files, misplaced assembly references or what more).
Cheers,
Imar
|
|
The Following User Says Thank You to Imar For This Useful Post:
|
|
|

December 12th, 2010, 07:56 AM
|
|
Authorized User
|
|
Join Date: Oct 2009
Posts: 33
Thanks: 7
Thanked 1 Time in 1 Post
|
|
Model editing caused problem
I found the following on Microsoft's ASP web site -
Quote:
"I deleted the Model file and the app.config file. Once deleted, I created them again, and it is now working.
I do not know why this hapenned, but somehow it is working."
Basically if you make any changes to the model this may happen.
|
I will admit that I, in effect, edited the model after creating it, but that is exactly what I said I was trying to do in my previous postings. I say, in effect, because I had, in book terms, to step back to Chapter 12, to add some relationships from within SSMS.
The connection string was not changed from what worked at step 5 to what then didn't work at step 10.
The solution was to delete the connection string line from web.config, delete the edmx and restart at step 1, going through in one clean go to step 10.
I apologise for having troubled you but it just seemed so strange for all the update model from database stuff to work at step 5, and then for it to fall over at step 10.
|
|

December 12th, 2010, 09:40 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Quote:
|
The connection string was not changed from what worked at step 5 to what then didn't work at step 10.
|
And that may be the problem. If you rename the model, your connection string is out of sync and needs to be updated as well. By deleting and recreating it, the problem goes away because VWD inserts the correct stuff in web.config. If you follow the short "new website and new model" exercise I suggested, it's easier to see how things are related to each other. Then, when you make an important change to the model such as renaming the model itself, you know what to fix manually in web.config, without starting over again.
The steps in the exercise on page 481-483 don't introduce a breaking change and you should be able to follow them without making a change to the config file manually. If you find something different, please let me know and I'll look into it.
Quote:
|
I will admit that I, in effect, edited the model after creating it, but that is exactly what I said I was trying to do in my previous postings.
|
Not sure which posts you're referring to exactly. But: making changes to the model is possible without changing the connection string, as long as you add and remove tables, rename them and so on. Renaming the model itself is a breaking change because of the references to the csdl, ssdl and msl parts in the connection string.
Quote:
|
I apologise for having troubled you but it just seemed so strange for all the update model from database stuff to work at step 5, and then for it to fall over at step 10.
|
You're not troubling me at all. (Otherwise I simply wouldn't post a reply). And the exercise should work from the first to the last step without manual changes, so I think you've also changed / renamed something that isn't part of the exercise. Could that be the problem?
Imar
|
|
 |