locked
Can't Create Association in Hosted Store. RRS feed

  • Question

  • I am trying to use your Astoria Data Store editor to create my data store online. I can not create a New Association.
     
     
    I have 2 Entities: Schools and Teachers.
     
    I am trying to Associate Teachers to Schools using the SchoolID2 in Schools to agree with SchoolID in Teachers. But whenever I change the NavigationProperty name and do an update, the Association Proprty names change back to NavigationProperty1.
     
    What is wrong? How do I make this association?
     
    Now That my data store has been created, How do I change(edit) the format of my data store?
     
    How do I add data to my data store?
     
    Is there another way to create my data store format instead on manually enetering it one field at a time?
     
    How do I delete my data store and create another one?

    --
    Thanks.
    Tuesday, August 7, 2007 4:11 PM

Answers

  • As Pablo noted, the editor will automatically revert an update to a field name that is deemed "invalid".  In short, a property name or association name for a given entity cannot be the same as the entity name or another property / association name.  Furthermore, when naming the association for the target entity in the relationship, the name of the association for the target follows a similar set of rules. 

     

     

     

    Thursday, August 9, 2007 5:53 AM

All replies

  •  DonBaechtel wrote:
    I am trying to use your Astoria Data Store editor to create my data store online. I can not create a New Association.
     
     
    I have 2 Entities: Schools and Teachers.
     
    I am trying to Associate Teachers to Schools using the SchoolID2 in Schools to agree with SchoolID in Teachers. But whenever I change the NavigationProperty name and do an update, the Association Proprty names change back to NavigationProperty1.
     
    What is wrong? How do I make this association?
    I did a similar thing but created the association on my equivalent of 'Teachers' first. This seems to give you what you want. Here's my conceptual data model:
     
    Code Snippet
    <?xml version="1.0" encoding="utf-8"?><edm:Schema Namespace="Model" Alias="Self" xmlns:edm="http://schemas.microsoft.com/ado/2006/04/edmhttp://schemas.microsoft.com/ado/2006/04/edm">http://schemas.microsoft.com/ado/2006/04/edm</A< A>>" xmlns:cg="http://schemas.microsoft.com/ado/2006/04/codegeneration">
     '>http://schemas.microsoft.com/ado/2006/04/codegeneration">http://schemas.microsoft.com/ado/2006/04/codegeneration">
     ; <edm:EntityContainer Name="Container">
        <edm:EntitySet Name="Person" EntityType="Model.Person" />
        <edm:EntitySet Name="Quote" EntityType="Model.Quote" />
        <edm:AssociationSet Name="NewAssociation1" Association="Model.NewAssociation1">
          <edm:End EntitySet="Quote" Role="Role1" />
          <edm:End EntitySet="Person" Role="Role2" />
        </edm:AssociationSet>
      </edm:EntityContainer>
      <edm:EntityType Name="Person" Key="ID">
        <edm:Property Name="ID" Type="Int32" Nullable="false" />
        <edm:Property Name="PersonName" Type="String" MaxLength="100" />
        <edm:NavigationProperty Name="Quotes" Relationship="Model.NewAssociation1" FromRole="Role2" ToRole="Role1" />
      </edm:EntityType>
      <edm:EntityType Name="Quote" Key="ID">
        <edm:Property Name="ID" Type="Int32" Nullable="false" />
        <edm:Property Name="QuoteText" Type="String" MaxLength="max" />
        <edm:NavigationProperty Name="PersonID" Relationship="Model.NewAssociation1" FromRole="Role1" ToRole="Role2" />
      </edm:EntityType>
      <edm:Association Name="NewAssociation1">
        <edm:End Type="Model.Quote" Multiplicity="*" Role="Role1" />
        <edm:End Type="Model.Person" Multiplicity="1" Role="Role2" />
      </edm:Association>
    </edm:Schema>

     

     

     
     DonBaechtel wrote:
    Now That my data store has been created, How do I change(edit) the format of my data store?
    You can't. I've complained about this on another thread on this forum.
     
     DonBaechtel wrote:
    How do I add data to my data store?
    use this tool: http://astoria.sandbox.live.com/Tools/raw.htm to issue HTTP POST requests. Note that it might not work for you and it won't tell you why - see my 'Hosted Data Services' thread on this forum.
     
     DonBaechtel wrote:
     
    Is there another way to create my data store format instead on manually enetering it one field at a time?
     
    Not yet.
     
     DonBaechtel wrote:
    How do I delete my data store and create another one?

    --
    Thanks.

     

     

    Try to create a new service and you get this message:

     

    WebService Name: Account Already Exists
    Error Information: A data service already exists which is associated with your passport account. If you wish to have your account deleted so you can create a new one, please navigate and signin to https://account.live.com/SettingsPage.aspx. Once signed in, record the 'Unique ID' value displayed and email the 'Unique ID' to astoriaf@microsoft.com. The subject of the email must be 'Delete my astoria account'. A member of the Astoria team will look into the problem and respond back to you.

     

     

    Regards

    Jamie

     

     

    Tuesday, August 7, 2007 6:48 PM
  • Some of your Code Snippet seems to be truncated or missing.

     

    How do I create a data store like you did with the Astoria editor provided? What steps did you go through? I can not quite follow what you did.

     

    Thanks for your help.

     

    I sure wish MS would at least respond to the problems listed and provide some help.

    Tuesday, August 7, 2007 9:35 PM
  •  DonBaechtel wrote:

    Some of your Code Snippet seems to be truncated or missing.

    Why do you say that? Looks OK to me.

     

     DonBaechtel wrote:

     

    How do I create a data store like you did with the Astoria editor provided? What steps did you go through? I can not quite follow what you did.

     

     I went here: http://astoria.mslivelabs.com/OnlineService.aspx, clicked on 'Create online data service' and went from there. All instructions are provided.

     

     

    -Jamie

     

    Tuesday, August 7, 2007 9:41 PM
  • Can you provide a simple sample of creating an Association successfully in the Astoria editor?

     

    The XML model you provided is very difficult for me to translate into steps to be performed in the Astoria editor.

     

    It would also help if the reasons for the failure of the Astoria editor to create the association in my example was explained.

     

    Thanks very much for your assistance.

    Tuesday, August 7, 2007 11:05 PM
  • The issue you may be running into is that the editor does not let you call the association-property with the same name as the containing entity (or the target entity I believe). Did you try giving it a different name?

     

    Also, the editor would revert your change if you use an illegal character (e.g. something that's not a letter or a number; a letter for the first character).

     

    Pablo Castro

    Technical Lead

    Microsoft Corporation

    http://blogs.msdn.com/pablo

     

    Wednesday, August 8, 2007 2:15 AM
    Moderator
  • As Pablo noted, the editor will automatically revert an update to a field name that is deemed "invalid".  In short, a property name or association name for a given entity cannot be the same as the entity name or another property / association name.  Furthermore, when naming the association for the target entity in the relationship, the name of the association for the target follows a similar set of rules. 

     

     

     

    Thursday, August 9, 2007 5:53 AM