DataWindows

The DataWindow control or DataStore object will be converted to C# models and stored in the PowerServer C# solution > "AppModels" project > [appname] > "Models" folder.


Each model represents one DataWindow and contains the schema of tables, columns, and procedure/function parameters, as shown in the example below. When there is data retrieval (or update), PowerServer Web APIs will get (or update) data from the database using the model and return the data to the client in JSON format. PowerBuilder Runtime will be responsible for populating and displaying the data to the client.

namespace salesdemo_cloud
{
    [DataWindow("d_dddw_address", DwStyle.Grid)]
    #region DwSelectAttribute  
    [DwSelect("PBSELECT( VERSION(400) TABLE(NAME=\"Person.Address\" ) @(_COLUMNS_PLACEHOLDER_) )")]
    #endregion
    public class D_Dddw_Address
    {
        [Identity]
        [SqlDefaultValue("autoincrement")]
        [DwColumn("Person.Address", "AddressID")]
        public int? Addressid { get; set; }

        [DwColumn("Person.Address", "AddressLine1")]
        public string Addressline1 { get; set; }

        [DwColumn("Person.Address", "City")]
        public string City { get; set; }

        [DwColumn("Person.Address", "StateProvinceID")]
        public int? Stateprovinceid { get; set; }

    }

}

Note

To generate the models correctly, accurate schema information is required, therefore, the IDE executes the SQL statement (Select statement or stored procedure) with a null retrieval argument. However, this is not well supported by the ASE database, and may cause performance issue or table locks.