Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Two tables + OptionDataSource

    Hi,

    lets say that i have two table in my database:

    Code:
    Users:
    =====
    UserId - int (autoincrement, primary key)
    Name - string
    and
    Code:
    Jobs
    =====
    JobId - int (autoincrement, primary key)
    WorkerId - int, foreigny key from table Users
    Title - string
    There is only one worker for each job but I don't think it really matters here.
    I read something about setOptionDataSource and I created a datasource containing all the columns from the following query:
    Code:
    select JobId,Title,WorkerId,Name from Users,Jobs where WorkerId = UserId
    But I dont know how to manage adding and updating rows. Can somebody tell me how to do this ?

    #2
    See this example. Notice how a join is specified for the fetch operation but updates occur against a single table. Setting "tableName" on a DataSource field excludes it from update/add operations. Be sure to read the Custom SQL overview for more options.

    Comment

    Working...
    X