Pergunta Rename Table in External Database

  • sexta-feira, 19 de agosto de 2011 14:04
     
     
    Is there a way to rename an external sql server table without loosing all your screens based on that table in LS?
    There is always a way. You just have to find it.

Todas as Respostas

  • sexta-feira, 19 de agosto de 2011 14:53
    Moderador
     
     

    Are you saying that you've tried an update data source & you DO lose your screens?

    If that's the case the only way would be to save a copy of the lsml file before the update & compare & change whatever's necessary.


    Yann

    (plus ça change, plus c'est la même chose!)

  • sexta-feira, 19 de agosto de 2011 15:30
     
     
    Yes, it deleted the old entity and created a new one (which makes sense since the reference is by table name, not table id). The screens are not deleted, but you looase all the controls referencing the old table. I will just have to stop being fussy and stick with the old name.
    There is always a way. You just have to find it.
  • segunda-feira, 30 de julho de 2012 11:23
     
     

    I was faced with the same problem. If I rename a table in SQL server and update my data source in LS then I lose all the screen controls related to it.

    I tried updating the isml file and then renaming the db table and then updating the datasource but I broke the project completely.

    I ended up copying the table with a new name and then adding it to the project and then building new screens against the new table using the old ones as examples. I then deleted the old table and screens.

    Surely there must be an easier way?

    Gus

  • segunda-feira, 30 de julho de 2012 15:50
    Moderador
     
     

    No, I don't think so. LS takes the approach of, if a property has disappeared (& if you think about it they all disappear with a table rename), that there's no point in trying to keep any control that was bound to it. When the table appears to be gone, then it makes no sense for the screen to remain.

    I'm sure that this was to try to not confuse users with screens/properties that suddenly weren't bound to anything.

    I wouldn't be surprised in this was handled better in a future release. And if there isn't one there already, you could submit a suggestion on LS's User Voice site. If you do end up submitting a suggestion, don't forget to put a link to it here in this thread, so other people can also vote on it as well.


    Yann - LightSwitch Central - Click here for FREE Themes, Controls, Types and Commands
     
    If you find a reply helpful, please click "Vote as Helpful", if a reply answers your question, please click "Mark as Answer"
     
    By doing this you'll help people find answers faster.