Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • eshan 12 posts 42 karma points
    Feb 01, 2013 @ 09:28
    eshan
    0

    Edit column in external database

    I'm connecting from external db and it show my data. But I can't figure out a way to add edit those records. Below is the my code.

    <container name="External database" connection="data source=;database=;user id=;password=">
          <repository name="Reviews">
              <primaryKey name="reviewID" />
    
              <view name="Reviews entries" pageSize="50" >
                  <columns>
                      <column field="DateAdded" title="Date Added" />
                      <column field="Rating" />
                      <column field="Title" />
                      <column field="Description" />
                      <column field="IsApproved" title="Is Approved"/>
                  </columns>
                  <sql>
                      <![CDATA[
                        SELECT reviewID, DateAdded, Rating, Title, Description, IsApproved
                        FROM tblReview
                      ]]>
                  </sql>
                  <editor tableName="tblReview">
                      <field title="ID" sourceField="reviewID" umbracoDataType="Textstring" readonly="true" />
                      <field title="Title" sourceField="Title" umbracoDataType="Textstring" /
                  </editor>
    
              </view>
          </repository>
      </container>

  • Sune Bøegh 64 posts 374 karma points
    Feb 03, 2013 @ 17:54
    Sune Bøegh
    0

    Hi Eshan,

    At first glance your configuration seems fine. But looking at your <editor /> above, there is an error in the Title-field:
    <fieldtitle="Title"sourceField="Title"umbracoDataType="Textstring" /
    Is missing the last >. So should be:
    <fieldtitle="Title"sourceField="Title"umbracoDataType="Textstring" />


    If this is not the problem, does an actual error occur when you try to edit or how does the problem manifest itself?

    About your question in the other thread about "yourowntype and yourownassembly", it was just related to the example, but I don't think it's applicable in your situation.

    - Sune

  • Sune Bøegh 64 posts 374 karma points
    Feb 03, 2013 @ 17:58
    Sune Bøegh
    100

    Oh, I just spotted the problem - you need to move your <editor /> element out of the <view /> element like this:
    <container name="External database" connection="data source=;database=;user id=;password=">
      <repository name="Reviews">
          <primaryKey name="reviewID" />
          <view name="Reviews entries" pageSize="50" >
          </view>
          <editor tableName="tblReview">
          </editor>
      </repository>
    </container>

    So that view and editor elements are on the same level - both as children of the repository-element.

    - Sune

  • eshan 12 posts 42 karma points
    Feb 05, 2013 @ 05:24
    eshan
    0

    Tx Sune. last one is the answer. :))))

Please Sign in or register to post replies

Write your reply to:

Draft