The DataWindow control or DataStore object will be converted to PowerServer C# models and stored in the PowerServer C# solution > "AppModels" project > [appname] > "Models" folder.
During the build & deploy process, if the data source of a DataWindow is a stored procedure, the stored procedure will be executed with default parameters in the database, in order to generate appropriate C# models.
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.
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.
Note
The original data type will be mapped to the C# data type, or the data type returned by PowerServer on executing SyntaxFromSQL. For the mapping rules, refer to Data type mappings.
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; } } }