none
Edit attached data (not the intrinsic data) possible? RRS feed

  • Question

  • Hi,

    I use "Attach to external Data Source" or "Add Data Source"  and import the Table object. Based on the table I created Editable Grid Screen. I can see the data stored in the external data source.

    But my problem is, even if my login user has the right to update the database (e.g. in SQL Management Studio), I cannot modify the data thought LightSwitch. Is that normal? My requirement is that I want to modify a table (insert / delete / update)  defined as external Data Source (of course not in Read-only mode).

    Can anyone help me ?

    Thanks.

    Andy

    Wednesday, January 14, 2015 12:03 PM

All replies

  • Hi Andy,

    It's definitely possible.  Does this happen during debug or only when published? 

    If debug, when you connected to the database (add datasource wizard) did you use Windows Auth or SQL Server Auth?

    If only when published, did you use Windows Auth or SQL Server Auth on the Data Connections | Attached Data Sources page of pub wiz?

    Josh

    Wednesday, January 14, 2015 3:27 PM
  • Hi, Josh,

    I reviewed my implementation and I found the error.

    I forgot to define the primary key and I got the eror when I refreshed the table definition (other settings such Windows Auth or SQL Server Auth are fine).

    The table/view 'MyDB.dbo.MyTable' does not have a primary key defined. The key has been inferred and the definition was created as a read-only table/view.

    After I added Primary Key to the table, it works as expected.

    Thanks a lot for your tip.

    Regards,

    Andy

    Wednesday, January 14, 2015 4:24 PM