locked
Dynamic Data Entity Framework Workaround problem RRS feed

  • Question

  • User-1246852455 posted

    http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=16367

    the above articles says to report problems with the fix.

    I have visual studio 2008 and 3.5 SP1 version of the dynamic data entities web application, so I thought it woudn't be an issue, but I am getting this error when adding a database that includes the aspnet_ generated membership tables.

    I tried adding the aspnet_X tables to my entity model and clicking to edit aspnet_Membership generates this error:

    DataBinding: 'System.Web.UI.WebControls.EntityDataSourceWrapper' does not contain a property with the name 'aspnet_Users.UserId'.

    Line 44:             Return ForeignKeyPath

    So I found the above article.

    I downloaded the zip and installed the dll into my /bin directory. It is also visible and included  in my project.

    But when I go to registercontext in the global.asax I get a squiggly error. This example uses C#, but I am using VB. Do I have it entered incorrectly?

     

            model.RegisterContext(New Microsoft.Web.DynamicData.EFDataModelProvider(GetType(MyTableEntities)), New ContextConfiguration() With {.ScaffoldAllTables = True})

    I get the error that Microsoft.Web.DynamicData.EFDataModelProvider is not defined.

    thanks.

     

     

     

     

    Wednesday, November 5, 2008 2:58 PM

Answers

  • User1641955678 posted

    If you're using a Web Application and not a Web Site, you shuold not add it to bin directly, but should instead add a reference.  The download page from which you got it has the instructions under 'Dynamic Data Entity Web Application'.

    thanks,
    David

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 5, 2008 4:03 PM
  • User-1246852455 posted

    That was it. Thanks!

    Here are the vb changes needed if you want to add them to the article:

           model.RegisterContext(New Microsoft.Web.DynamicData.EFDataModelProvider(GetType(MyEntities)), New ContextConfiguration() With {.ScaffoldAllTables = True})

        Protected Function GetDisplayString() As String
            Try
                Return FormatFieldValue(ForeignKeyColumn.ParentTable.GetDisplayString(FieldValue))
            Catch ex As Exception
                Return ForeignKeyColumn.ParentTable.DisplayName
            End Try
        End Function

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, November 6, 2008 1:08 AM

All replies

  • User1641955678 posted

    If you're using a Web Application and not a Web Site, you shuold not add it to bin directly, but should instead add a reference.  The download page from which you got it has the instructions under 'Dynamic Data Entity Web Application'.

    thanks,
    David

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 5, 2008 4:03 PM
  • User-1005219520 posted

    Hi Nannette,

    I'm sorry the instructions do not include VB. I'll see if I can get them updated. It looks like your VB is correct (if you have the correct type listed.) From the looks of your error, I think David is right. Here is the VB I'm using with the AdventureWorksLT DB.

       ' model.RegisterContext(GetType(AWLT08Model.AWLT08Entities), New ContextConfiguration() With {.ScaffoldAllTables = True})
            model.RegisterContext(New Microsoft.Web.DynamicData.EFDataModelProvider(GetType(AWLT08Model.AWLT08Entities)), New ContextConfiguration() With {.ScaffoldAllTables = True})
    
     
    Wednesday, November 5, 2008 11:56 PM
  • User-1246852455 posted

    That was it. Thanks!

    Here are the vb changes needed if you want to add them to the article:

           model.RegisterContext(New Microsoft.Web.DynamicData.EFDataModelProvider(GetType(MyEntities)), New ContextConfiguration() With {.ScaffoldAllTables = True})

        Protected Function GetDisplayString() As String
            Try
                Return FormatFieldValue(ForeignKeyColumn.ParentTable.GetDisplayString(FieldValue))
            Catch ex As Exception
                Return ForeignKeyColumn.ParentTable.DisplayName
            End Try
        End Function

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, November 6, 2008 1:08 AM
  • User660823006 posted

    I updated the download page for the fix for entity framework to include VB code. Thanks!

    Friday, November 7, 2008 8:29 PM