schema updater

Thread is closed for posting
3 posts, 0 answers
  1. amir sherafatian
    amir sherafatian avatar
    42 posts
    Member since:
    Aug 2009

    Posted 25 Aug 2009 Link to this post

    how can i update my database schema after i add the artificial field ?
    do i set schema update property to true in app.config or any where ?
    is there any setting that i shoud do this ?
  2. IT-Als
    IT-Als avatar
    381 posts
    Member since:
    Sep 2008

    Posted 25 Aug 2009 Link to this post

    Hi amir,

    It depends on how you structured your project.

    If you have a class lib (assembly) containing the model (persistent classes) and another assembly (or main program) consuming this assembly, you should set the UpdateDatabase property of that project to true. It is set in VS for the properties of the project. Click on the project, go to the properties tab and there you'll find the UpdateDatabase.

    Usually it is in the project, where the app.config file containing the connection information for OA resides.

  3. PetarP
    PetarP avatar
    754 posts

    Posted 27 Aug 2009 Link to this post

    Hi Henrik,

    You can do that in both run-time and design-time.
    If you would like to do this in design time then you should write your artificial fields by hand in the app.config file. Once you are done just set the UpdateDatabase to true and rebuild. This will automatically create the required ddl script and update the database.
    If you would like to use this in runtime, you should apply your artificial fields using the XML approach and use this code:
    ISchemaHandler schema = Database.Get("DatabaseConnection1").GetSchemaHandler(); 
    This will create a ddl script and execute it against the database.

    Sincerely yours,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top