locked
is it possible to add collumns to entity via code? RRS feed

  • Question

  • Hello everyone...

     

    I have one table called paymentcompany type with has company and payment type related and i would like each time i a new record is inserted in the database, it would create a column in one other table? is it possible to manipulate entity in runtime??

    Any help would be great.

     

    Best regards

    Monday, July 25, 2011 10:36 PM

Answers

  • Hi Techno,

    If you actually mean create a new colum, i.e. change the database schema on the fly, then no. If you mean update data in another table when you insert a record in another table, then yes, it's possible to do this in the Inserting method. See the following topic for an example: http://msdn.microsoft.com/en-us/library/ff851990.aspx#SavingData

    Hope this helps,


    Steve Hoag Microsoft aka the V-Bee
    • Proposed as answer by Yann Duran Tuesday, July 26, 2011 4:32 AM
    • Marked as answer by TechnoSQuirreL Tuesday, July 26, 2011 8:09 AM
    Tuesday, July 26, 2011 2:02 AM
    Moderator

All replies

  • Hi Techno,

    If you actually mean create a new colum, i.e. change the database schema on the fly, then no. If you mean update data in another table when you insert a record in another table, then yes, it's possible to do this in the Inserting method. See the following topic for an example: http://msdn.microsoft.com/en-us/library/ff851990.aspx#SavingData

    Hope this helps,


    Steve Hoag Microsoft aka the V-Bee
    • Proposed as answer by Yann Duran Tuesday, July 26, 2011 4:32 AM
    • Marked as answer by TechnoSQuirreL Tuesday, July 26, 2011 8:09 AM
    Tuesday, July 26, 2011 2:02 AM
    Moderator
  • Thanks Steve,

     

    My idea was to have a table that records in it would be the header of another table and make it grow horizontally, as needed. In that case is there an option to create a crosstab with insert and update?

     

    Best Regards

    Tuesday, July 26, 2011 8:17 AM