locked
Dynamic Data Website help? RRS feed

  • Question

  • User-620767395 posted

    Hi,

     

    I am currently working through a book by wrox called Beg Visual Basic 2012 and one of the last chapters has to do with Dynamic Data Website and asp.net. while working through one of the examples I have ran into problems. the example is to create a basic dynamic data website so I created new website selecting the "ASP.net dynamic data entities web site"  then using the "Entity Data Model wizard" I choose to generate from database. Selecting pubs.mdf database from the MS SQL server 2012 database examples. Once I completed the wizard the book has me view the Global.asax file and change a line called "DefaultModel.RegisterContext" and more specifically change "RegisterRoutes" default method to "pubsModel.pubsEntities".  The full line is featured below.

    "DefaultModel.RegisterContext(GetType(pubsModel.pubsEntities), New ContextConfiguration() With {.ScaffoldAllTables = True})"

     

    Once I type in "pubsModel.pubsEntities" the method is underline as an error. I have pasted the full error below. Also a three message are displayed within the error list which is also pasted below.

     

    Error list:

     

    "Error 6 Type 'pubsModel.pubsEntities' is not defined. C:\Users\NVSYS\Documents\Visual Studio 2012\Projects\dda\Global.asax 25 46 dda"

     

    "Message 1 The table/view 'C:\USERS\NVSYS\DOCUMENTS\VISUAL STUDIO 2012\PROJECTS\DDA\APP_DATA\PUBS.MDF.dbo.discounts' does not have a primary key defined. The key has been inferred and the definition was created as a read-only table/view. C:\Users\NVSYS\Documents\Visual Studio 2012\Projects\dda\App_Code\Model.edmx 0 1 dda"

     

    I have tried redoing the example a couple of times to make sure I did not miss a step. At this point I don’t know what to do since I am very need to ASP.net and dynamic data website topics. Any help would be greatly appreciated!

     

    Thanks,

    JT

    Tuesday, January 22, 2013 11:14 PM

Answers

  • User-166373564 posted

    Hi jt

    Perhaps some guide is helpful for you to create dynamic data website.

    This step by step guide will automagically create a basic dynamic data website, you’ll be able to create, read, update and delete the records in your database tables via your own web application.

    How to build a basic Dynamic Data website

    At the same time other relevant tutorials are also available for you,

    Create an ASP.NET Dynamic Data Website Using ADO.NET Entity Framework here

    Create a Read-Only Dynamic Data Web Site here.

    hope it helps you,

    Kind regards

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, January 29, 2013 10:09 PM

All replies

  • User-1716253493 posted

    Maybe you forget to set a column in discounts table as primary key. Try redesign the discounts table.

    Wednesday, January 23, 2013 1:21 AM
  • User-620767395 posted

    thanks for suggestion... I try redesing discounts table; however, I am still receiving 'pubsModel.pubsEntities' is not defined

    Wednesday, January 23, 2013 11:00 AM
  • User-620767395 posted

    I have been looking into problem for some time and with my limited knowledge If my understanding is correct "pubsmodel" portion of pubsModel.pubsEntities' is referanceing pubsmodel namespace. I guess how would I make sure pubsmodel namespace is added to my project? I understand with a normal VB project you would look into the "myproject" section of the solution to see all imported namespaces and wheatear they are checked or not... I am loss and don’t know where to go in this type of solution which does not feature myproject selection. 


    Wednesday, January 23, 2013 9:15 PM
  • User-166373564 posted

    Hi jt

    Perhaps some guide is helpful for you to create dynamic data website.

    This step by step guide will automagically create a basic dynamic data website, you’ll be able to create, read, update and delete the records in your database tables via your own web application.

    How to build a basic Dynamic Data website

    At the same time other relevant tutorials are also available for you,

    Create an ASP.NET Dynamic Data Website Using ADO.NET Entity Framework here

    Create a Read-Only Dynamic Data Web Site here.

    hope it helps you,

    Kind regards

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, January 29, 2013 10:09 PM