So, when trying to test out the basic funtionality of dynamic data, I get the exception "DataBinding: 'System.Web.UI.WebControls.EntityDataSourceWrapper' does not contain a property with the name 'Store'."
When ever I click on the Customer Tables on the Default.aspx page. I also get the message with the property name Individual as well.
Using the AdventureWorks database, I add all the Sales schema table objects to the model and referece the model in the global.ascx file.
However, when I do the same thing using Linq to SQL everything works fine.
<div mce_keep="true">Microsoft Visual Studio 2008
Version 9.0.30428.1 SP1Beta1
Microsoft .NET Framework
Version 3.5 SP1</div>
<div mce_keep="true">Also, I did downloaded and executed the install.cmd file in the zip Dynamic_Data_Runtime_and_Templates_0523a</div>
Steps to reproduce the problem:
<div mce_keep="true">Create New Dynamic Entity Web Site </div>
<div mce_keep="true">Add new ADO.Net Entity Data Model</div>
<div mce_keep="true">Using Entity wizard, connect to the AdvetureWorks DB, add the tables Sales.Customer, Sales.Individual and Sales.Store to the context</div>
<div mce_keep="true">Uncomment the model.RegisterContext and add name of newly created Entity Data Model context type and set scaffoldAll to true</div>
<div mce_keep="true">Run application and click on Customer to view Customer records in GridView. </div>
Note: Error messag will say "Property name individual", but if you remove the individual table from the context you will get the same message for the Shop table as well.
Ok...here is the entire stack trace from the web when I run the website
1 Server Error in
'/EntityDD1' Application. 2 -------------------------------------------------------------------------------- 3 4 DataBinding: 'System.Web.UI.WebControls.EntityDataSourceWrapper' does not contain a property with the name 'Store'.
5 Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
6 7 Exception Details: System.Web.HttpException: DataBinding:
'System.Web.UI.WebControls.EntityDataSourceWrapper' does not contain a property with the name 'Store'. 8 9 Source Error: 10 11 12 Line 34: 13 Line 35: Protected Function GetDisplayString()
As String 14 Line 36: Return FormatFieldValue(ForeignKeyColumn.ParentTable.GetDisplayString(FieldValue)) 15 Line 37: End Function 16 Line 38: 17 18 19 Source File: C:\Projects\2008\Testing\EntityDD1\DynamicData\FieldTemplates\ForeignKey.ascx.vb Line: 36
20 21 Stack Trace: 22 23 24 [HttpException (0x80004005): DataBinding: 'System.Web.UI.WebControls.EntityDataSourceWrapper' does not contain a property with the name 'Store'.] 25 System.Web.UI.DataBinder.GetPropertyValue(Object container,
String propName) +8650741 26 System.Web.DynamicData.FieldTemplateUserControl.GetColumnValue(MetaColumn column) +168 27 System.Web.DynamicData.FieldTemplateUserControl.get_FieldValue() +100 28 ForeignKeyField.GetDisplayString() in C:\Projects\2008\Testing\EntityDD1\DynamicData\FieldTemplates\ForeignKey.ascx.vb:36 29 ASP.dynamicdata_fieldtemplates_foreignkey_ascx.__DataBindingHyperLink1(Object sender, EventArgs e) in C:\Projects\2008\Testing\EntityDD1\DynamicData\FieldTemplates\ForeignKey.ascx:3 30 System.Web.UI.Control.OnDataBinding(EventArgs e) +99 31 System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +92 32 System.Web.UI.Control.DataBind() +15 33 System.Web.UI.Control.DataBindChildren() +211 34 System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102 35 System.Web.UI.Control.DataBind() +15 36 System.Web.UI.Control.DataBindChildren() +211 37 System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102 38 System.Web.UI.Control.DataBind() +15 39 System.Web.UI.Control.DataBindChildren() +211 40 System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102 41 System.Web.UI.Control.DataBind() +15 42 System.Web.UI.Control.DataBindChildren() +211 43 System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102 44 System.Web.UI.Control.DataBind() +15 45 System.Web.UI.WebControls.GridView.CreateRow(Int32 rowIndex, Int32 dataSourceIndex, DataControlRowType rowType, DataControlRowState rowState,
Boolean dataBind, Object dataItem, DataControlField[] fields, TableRowCollection rows, PagedDataSource pagedDataSource) +155 46 System.Web.UI.WebControls.GridView.CreateChildControls(IEnumerable dataSource,
Boolean dataBinding) +2002 47 System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +57 48 System.Web.UI.WebControls.GridView.PerformDataBinding(IEnumerable data) +14 49 System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +114 50 System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +31 51 System.Web.UI.WebControls.DataBoundControl.PerformSelect() +142 52 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73 53 System.Web.UI.WebControls.GridView.DataBind() +4 54 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82 55 System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +72 56 System.Web.UI.Control.EnsureChildControls() +87 57 System.Web.UI.Control.PreRenderRecursiveInternal() +44 58 System.Web.UI.Control.PreRenderRecursiveInternal() +171 59 System.Web.UI.Control.PreRenderRecursiveInternal() +171 60 System.Web.UI.Control.PreRenderRecursiveInternal() +171 61 System.Web.UI.Control.PreRenderRecursiveInternal() +171 62 System.Web.UI.Control.PreRenderRecursiveInternal() +171 63 System.Web.UI.Control.PreRenderRecursiveInternal() +171 64 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint) +842 65 66 67 68 69 -------------------------------------------------------------------------------- 70 Version Information: Microsoft .NET Framework Version:2.0.50727.3031; ASP.NET Version:2.0.50727.3031
Thanks for the repro steps. This appears to be caused by the fact that Customer has a 1 to 1 relationship with Individual, and that EntityDataSource doesn't handle this well. We are investigating further.
Is there any chance that this problem still exists in the RTM version?
I have a PersonSimple(PersonID PK, foo varchar(50)) table and a PersonExtended(PersonID PK, bar varchar(50)) table and when I open PersonExtended in the Dynamic Data Entites App it fails with the message
DataBinding: 'System.Web.UI.WebControls.EntityDataSourceWrapper' does not contain a property with the name 'PersonSimple.PersonID'
(It doesn't happen when there are no rows in PersonExtended.)
Microsoft Student Partner
University of Technology, Vienna
Windows XP Pro SP3 (also happens on Vista Ultimate SP1)
VS Team System 2008 Development Edition SP1
SQL Server 2008 Developer Edition
.Net Framework 3.5 SP1
I'm looking forward to the next edition of EF where these types of issues are resolved up front when the model is first created from the database schema.
Can you confirm if this is still an issue in VS2010 + Dot Net 4.0 Beta 1 ? I have this issue but can only find fixes for frameworks upto and including 3.5 SP1, not anything for the Dot Net 4.0 version?
Nona.Drake@S...
0 Points
9 Posts
Binding Exception when using Entity DataModel vs Linq to SQL Classes
Jun 04, 2008 05:11 AM|LINK
So, when trying to test out the basic funtionality of dynamic data, I get the exception "DataBinding: 'System.Web.UI.WebControls.EntityDataSourceWrapper' does not contain a property with the name 'Store'."
When ever I click on the Customer Tables on the Default.aspx page. I also get the message with the property name Individual as well.
Using the AdventureWorks database, I add all the Sales schema table objects to the model and referece the model in the global.ascx file.
However, when I do the same thing using Linq to SQL everything works fine.
Any ideas?
NONA
marcind
Contributor
3344 Points
609 Posts
Microsoft
Re: Binding Exception when using Entity DataModel vs Linq to SQL Classes
Jun 04, 2008 07:53 AM|LINK
Hi,
could you provide the full stack trace of the exception you are seeing (check this post for info on how to enable full stack traces).
Are you using the latest (5/23) build of Dynamic Data available on code gallery?
ASP.NET Team
@marcind
Blog
Nona.Drake@S...
0 Points
9 Posts
Re: Binding Exception when using Entity DataModel vs Linq to SQL Classes
Jun 04, 2008 11:07 PM|LINK
Current Installation:
Version 9.0.30428.1 SP1Beta1
Microsoft .NET Framework
Version 3.5 SP1</div>
Steps to reproduce the problem:
Note: Error messag will say "Property name individual", but if you remove the individual table from the context you will get the same message for the Shop table as well.
Ok...here is the entire stack trace from the web when I run the website
1 Server Error in '/EntityDD1' Application.
2 --------------------------------------------------------------------------------
3
4 DataBinding: 'System.Web.UI.WebControls.EntityDataSourceWrapper' does not contain a property with the name 'Store'.
5 Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
6
7 Exception Details: System.Web.HttpException: DataBinding: 'System.Web.UI.WebControls.EntityDataSourceWrapper' does not contain a property with the name 'Store'.
8
9 Source Error:
10
11
12 Line 34:
13 Line 35: Protected Function GetDisplayString() As String
14 Line 36: Return FormatFieldValue(ForeignKeyColumn.ParentTable.GetDisplayString(FieldValue))
15 Line 37: End Function
16 Line 38:
17
18
19 Source File: C:\Projects\2008\Testing\EntityDD1\DynamicData\FieldTemplates\ForeignKey.ascx.vb Line: 36
20
21 Stack Trace:
22
23
24 [HttpException (0x80004005): DataBinding: 'System.Web.UI.WebControls.EntityDataSourceWrapper' does not contain a property with the name 'Store'.]
25 System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName) +8650741
26 System.Web.DynamicData.FieldTemplateUserControl.GetColumnValue(MetaColumn column) +168
27 System.Web.DynamicData.FieldTemplateUserControl.get_FieldValue() +100
28 ForeignKeyField.GetDisplayString() in C:\Projects\2008\Testing\EntityDD1\DynamicData\FieldTemplates\ForeignKey.ascx.vb:36
29 ASP.dynamicdata_fieldtemplates_foreignkey_ascx.__DataBindingHyperLink1(Object sender, EventArgs e) in C:\Projects\2008\Testing\EntityDD1\DynamicData\FieldTemplates\ForeignKey.ascx:3
30 System.Web.UI.Control.OnDataBinding(EventArgs e) +99
31 System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +92
32 System.Web.UI.Control.DataBind() +15
33 System.Web.UI.Control.DataBindChildren() +211
34 System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102
35 System.Web.UI.Control.DataBind() +15
36 System.Web.UI.Control.DataBindChildren() +211
37 System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102
38 System.Web.UI.Control.DataBind() +15
39 System.Web.UI.Control.DataBindChildren() +211
40 System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102
41 System.Web.UI.Control.DataBind() +15
42 System.Web.UI.Control.DataBindChildren() +211
43 System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102
44 System.Web.UI.Control.DataBind() +15
45 System.Web.UI.WebControls.GridView.CreateRow(Int32 rowIndex, Int32 dataSourceIndex, DataControlRowType rowType, DataControlRowState rowState, Boolean dataBind, Object dataItem, DataControlField[] fields, TableRowCollection rows, PagedDataSource pagedDataSource) +155
46 System.Web.UI.WebControls.GridView.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) +2002
47 System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +57
48 System.Web.UI.WebControls.GridView.PerformDataBinding(IEnumerable data) +14
49 System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +114
50 System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +31
51 System.Web.UI.WebControls.DataBoundControl.PerformSelect() +142
52 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73
53 System.Web.UI.WebControls.GridView.DataBind() +4
54 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
55 System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +72
56 System.Web.UI.Control.EnsureChildControls() +87
57 System.Web.UI.Control.PreRenderRecursiveInternal() +44
58 System.Web.UI.Control.PreRenderRecursiveInternal() +171
59 System.Web.UI.Control.PreRenderRecursiveInternal() +171
60 System.Web.UI.Control.PreRenderRecursiveInternal() +171
61 System.Web.UI.Control.PreRenderRecursiveInternal() +171
62 System.Web.UI.Control.PreRenderRecursiveInternal() +171
63 System.Web.UI.Control.PreRenderRecursiveInternal() +171
64 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842
65
66
67
68
69 --------------------------------------------------------------------------------
70 Version Information: Microsoft .NET Framework Version:2.0.50727.3031; ASP.NET Version:2.0.50727.3031
davidebb
Contributor
7006 Points
1366 Posts
Microsoft
Re: Binding Exception when using Entity DataModel vs Linq to SQL Classes
Jun 05, 2008 01:49 AM|LINK
Hi Nona,
Thanks for the repro steps. This appears to be caused by the fact that Customer has a 1 to 1 relationship with Individual, and that EntityDataSource doesn't handle this well. We are investigating further.
thanks,
David
Nona.Drake@S...
0 Points
9 Posts
Re: Binding Exception when using Entity DataModel vs Linq to SQL Classes
Jun 05, 2008 04:30 AM|LINK
You know...for some reason I was thinking that in the back of my mind, but thought...nooo....I'm doing something wrong.
Well it's a work in progress. And progress you guys have made in deed! [Yes]
Gidion
Member
11 Points
5 Posts
Re: Binding Exception when using Entity DataModel vs Linq to SQL Classes
Aug 12, 2008 06:39 PM|LINK
Is there any chance that this problem still exists in the RTM version?
I have a PersonSimple(PersonID PK, foo varchar(50)) table and a PersonExtended(PersonID PK, bar varchar(50)) table and when I open PersonExtended in the Dynamic Data Entites App it fails with the message
DataBinding: 'System.Web.UI.WebControls.EntityDataSourceWrapper' does not contain a property with the name 'PersonSimple.PersonID'
(It doesn't happen when there are no rows in PersonExtended.)
University of Technology, Vienna
marcind
Contributor
3344 Points
609 Posts
Microsoft
Re: Binding Exception when using Entity DataModel vs Linq to SQL Classes
Aug 16, 2008 01:11 AM|LINK
Yes, this is a problem that is unfortunately still present in SP1 RTM. We are working on a fix and should provide a workaround soon.
ASP.NET Team
@marcind
Blog
fmorris0
Member
13 Points
10 Posts
Re: Binding Exception when using Entity DataModel vs Linq to SQL Classes
Sep 26, 2008 01:45 PM|LINK
FYI: this also happens using the example School database that I took from http://msdn.microsoft.com/en-us/library/bb399731.aspx
My environment:
Windows XP Pro SP3 (also happens on Vista Ultimate SP1)
VS Team System 2008 Development Edition SP1
SQL Server 2008 Developer Edition
.Net Framework 3.5 SP1
I'm looking forward to the next edition of EF where these types of issues are resolved up front when the model is first created from the database schema.
ricka6
All-Star
15070 Points
2272 Posts
Microsoft
Moderator
Re: Binding Exception when using Entity DataModel vs Linq to SQL Classes
Sep 26, 2008 03:36 PM|LINK
This has been fixed see http://forums.asp.net/t/1306469.aspx You need to install the Dynamic Data Entity Framework Workaround on codeplex.
Simon France...
Member
13 Points
23 Posts
Re: Binding Exception when using Entity DataModel vs Linq to SQL Classes
Sep 26, 2009 05:51 AM|LINK
Hi Marcin,
Can you confirm if this is still an issue in VS2010 + Dot Net 4.0 Beta 1 ? I have this issue but can only find fixes for frameworks upto and including 3.5 SP1, not anything for the Dot Net 4.0 version?
Cheers
Simon