By Ruben Gatt
June 2010
In this tutorial we take a quick glance at the new features that have been implemented in the new version of the DotNetMushroom Rapid Application Development Module.
We walk you through several of DNM RAD’s new features: creating a new data source, creating a linked table, creating a direct query and the new colour coded editor.
If you are unfamiliar with DNM RAD and its application development possibilities we recommend you have a look at the following tutorials:
How to Build a News Application with DotNetMushroom RAD
How to Implement Multi-Language Localization With DotNetMushroom RAD
How to Implement Paging with DotNetMushroom RAD
How to Implement a News Carousel Using DotNetMushroom RAD and JQuery
The new version of DNM RAD 01.20.00 enhances some of its basic functionality to improve usability and includes new features that will cater for any possible application scenarios.
Creating a Data Source
Aim: The aim of
Data Sources is to access data stored in a different database instance.
Example: Our local data is stored in
database A and the data we want to access is on
database B.
Instructions: In order to access
database B from DotNetMushroom RAD we need to follow the steps below.
Step 1: Get the Connection String of the database we want to connect to, in this case
database B.
Data Source=DRAKE; Initial Catalog=Eshop_Database; User ID=doc; Password=pass123;
Step 2: The next step is to go to the
Data Sources section by clicking on the
Data Sources link.
Screenshot - Data Sources button and the Data Sources pane
Step 3: Next press on
New Data Source. A form will load where we need to enter the
Data Source name and the Connection String to connect to the database which has already been copied.
The
Data Source name can be anything as it will not have any affect on the Module, but it should be named appropriately in order to easily recognise the
Data Source. In this case the
Data Source was named
Database B.
Screenshot - Data Sources form
Step 4: Finally press the
Test button in order to test that the connection string is working. If everything is fine press the
Save button.
Screenshot - Data Sources Save , Delete and Test buttons
Creating a Linked Table
Aim: The aim of
Linked Tables is to access data stored in a different database instance by using the
Data Source representing that database instance.
Example: The data we want to access is stored in
database B which is represented by the
Database B Data Source within the
Users table.
Instructions: In order to access the
Users table using the DotNetMushroom RAD we need to follow the steps below.
Step 1: Go to the
Tables section by clicking on the
Tables link. (as shown in the screenshot below)
Screenshot – Tables link and Tables panel
Step 2: Next press on
New Linked Table.
A form will be displayed where we need to select the
Data Source, the
Table, and the
Primary Key of the
Table. We also need to enter the
Friendly Name of the
Linked Table.
Screenshot – Linked Table form
The sample data that was chosen is as follows:
Data Source:
Database B
Table:
Users
Primary Key:
UserID
Friendly Name:
Users
Step 3: After selecting and entering the appropriate data press the
Save button.
Screenshot – Linked Table generated fields
Step 4: Now the Table fields are automatically populated from the Users table from within database B.
Creating a Direct Query
Since
Data Sources have been introduced there are 2 types of queries that can be created.
Screenshot – Queries panel
As shown in the screenshot above now we have a
New Query button and a
Direct Query button.
The difference between the two is that the
New Query is used solely for
DotNetMushroom tables. By creating a
Direct Query we can interact with all the tables present in the local and in the external database by using the
Data Source.
In order to create a
Direct Query we need to follow these steps.
Step 1: Go to the
Queries section and click on
Direct Query from the
Queries panel.
Screenshot – Linked Table generated fields
Step 2: First select the
Data Source from where the query will get its data. In this case we will use
Database B.
For the
Query Name we have used
Users_Info to distinguish this query from others.
Screenshot – Direct Query form
Step 3: Before saving the
Query press the
Execute button to test that the data is loaded correctly.
Screenshot – Direct Query Save, Delete and Execute buttons
Step 4: After confirming that the correct data is being loaded press the
Save button to save the
Query.
New Colour Coding Editor
In the new version of DNM RAD a new editor has been introduced that has the ability to colour code and auto-indent code which ultimately makes it easier to understand and maintain code.
The new editor can be used when creating Queries in the SQL textbox which colour codes according to SQL keywords, it can also be used when creating/editing Form Templates and when creating/editing a JavaScript Control (as shown in the screenshot below).
Screenshot – Javascript Control Editor
Changing text editor in forms
By default the
View as Textbox option is set to
Textbox Editor so the new text editor is being used. In order to change to the FCK editor we need to change the
View as Textbox to
Text/HTML Provider and press the
Save button.
Screenshot – Textbox Editor Selection
If you have any problems working with the DNM RAD module you can visit the
DotNetMushroom Forums.
Comments