locked
Dynamic Data LinqToSQL Framework Workaround? RRS feed

  • Question

  • User-2135633990 posted

    I have seen there is a post: Dynamic Data Entity Framework Workaround

    I am experiencing the same problem (No property or field 'xxx1' exists in type 'tabletype' ) in a LinqToSQL project, but the workaround seems to target Linq To Entities only.

    Does the Dynamic Data Entity Framework Workaround also apply to LinqToSQL?

     

    Monday, September 1, 2008 11:41 AM

All replies

  • User188291263 posted

     I fixed it by using Where proprety on LinqDataSource,instead WhereParameters.

    Monday, September 1, 2008 1:22 PM
  • User660823006 posted

    Are you having this issue with a Dynamic Data application or is this justa  general LinqToSql question? The issue the fix was for was for Dynamic Data applications. Give us more detail and we can try and help.

    Monday, September 1, 2008 4:55 PM
  • User-2135633990 posted

    This is a problem with dynamic data, which manifests as an error message in the form:  No property or field 'xxx1' exists in type 'tabletype' .

     This error can be provoked by having one field used in two foreign key relations.

    A reproducable example:

    Create a new dynamic data website, and add a new database to it.

    In this database, we create two tables:  One is going to represent Steps in a project, called STEP and has fields Project, Stepnumber and Description. Project and Stepnumber are the primary key.

    The second table represents the restriction that some steps can only start when others finish, called RESTRICTION,  has fields:  ID, Project, StepPreceding and StepSucceding. ID is the primary key.

    Now add two relations:  RESTRICTION(Project,StepPreceding) ==> Step(Project,Stepnumber) and RESTRICTION(Project,StepSucceding) ==> Step(Project,Stepnumber)

    Put these tables in a new dbml, enable dynamic data with scaffolding for it in the globals.asax and run.

    Insert two steps in the step table, both project TEST,  and stepnumber 1 and 2. In the restriction table add a row that step 1 must preceed step 2.

    Now try to navigate from the RESTRICTION list to the steps.  This will give an error.

     

     

    Tuesday, September 2, 2008 7:54 AM